return new Dimension(width, height);
Insets tabPaneInsets = tabPane.getInsets(); return new Dimension(width + tabPaneInsets.left + tabPaneInsets.right, height + tabPaneInsets.top + tabPaneInsets.bottom);
    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);            }        }      if (tabPlacement == SwingConstants.TOP          || tabPlacement == SwingConstants.BOTTOM)        {          int min = calculateMaxTabWidth(tabPlacement);          width = Math.max(min, componentWidth);                    int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width);          height = tabAreaHeight + componentHeight;        }      else        {          int min = calculateMaxTabHeight(tabPlacement);          height = Math.max(min, componentHeight);                    int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height);          width = tabAreaWidth + componentWidth;        }      return new Dimension(width, height);    }