int width = 0;
int width = insets.bottom + insets.right + 3;
  protected int calculateTabWidth(int tabPlacement, int tabIndex,                                  FontMetrics metrics)  {    Icon icon = getIconForTab(tabIndex);    Insets insets = getTabInsets(tabPlacement, tabIndex);    int width = 0;    if (icon != null)      {        Rectangle vr = new Rectangle();        Rectangle ir = new Rectangle();        Rectangle tr = new Rectangle();        layoutLabel(tabPlacement, getFontMetrics(), tabIndex,                    tabPane.getTitleAt(tabIndex), icon, vr, ir, tr,                    tabIndex == tabPane.getSelectedIndex());        width = tr.union(ir).width;      }    else      width = metrics.stringWidth(tabPane.getTitleAt(tabIndex));    width += insets.left + insets.right;    return width;  }