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()); calcRect = tr.union(ir);
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;
  protected int calculateTabWidth(int tabPlacement, int tabIndex,                                  FontMetrics metrics)  {    Icon icon = getIconForTab(tabIndex);    Insets insets = getTabInsets(tabPlacement, tabIndex);    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());	calcRect = tr.union(ir);      }    else      calcRect.width = metrics.stringWidth(tabPane.getTitleAt(tabIndex));    calcRect.width += insets.left + insets.right;    return calcRect.width;  }