height = calculateMaxTabHeight(tabPlacement) * tabPane.getTabCount(); calcRect = tabPane.getParent().getBounds(); height = Math.max(height, componentHeight);
int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, componentHeight);
    protected Dimension calculateSize(boolean minimum)    {      int tabPlacement = tabPane.getTabPlacement();      int width = 0;      int height = 0;      int componentHeight = 0;      int componentWidth = 0;      Component c;      Dimension dims;      for (int i = 0; i < tabPane.getTabCount(); i++)        {	  c = tabPane.getComponentAt(i);	  if (c == null)	    continue;	  calcRect = c.getBounds();	  dims = c.getPreferredSize();	  if (dims != null)	    {	      componentHeight = Math.max(componentHeight, dims.height);	      componentWidth = Math.max(componentWidth, dims.width);	    }        }      Insets insets = tabPane.getInsets();	      if (tabPlacement == SwingConstants.TOP          || tabPlacement == SwingConstants.BOTTOM)        {	  width = calculateMaxTabWidth(tabPlacement) * tabPane.getTabCount();	  calcRect = tabPane.getParent().getBounds();	  width = Math.max(width, componentWidth);	  int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width);	  height = tabAreaHeight + componentHeight;        }      else        {	  height = calculateMaxTabHeight(tabPlacement) * tabPane.getTabCount();	  calcRect = tabPane.getParent().getBounds();	  height = Math.max(height, componentHeight);	  int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height);	  width = tabAreaWidth + componentWidth;        }      return new Dimension(width, height);    }