Color saved = g.getColor(); calcRect = iconRect.union(textRect);
if (tabPane.hasFocus() && isSelected) { Rectangle rect = rects[tabIndex];  int x; int y; int w; int h;
  protected void paintFocusIndicator(Graphics g, int tabPlacement,                                     Rectangle[] rects, int tabIndex,                                     Rectangle iconRect, Rectangle textRect,                                     boolean isSelected)  {    Color saved = g.getColor();    calcRect = iconRect.union(textRect);    g.setColor(focus);    g.drawRect(calcRect.x, calcRect.y, calcRect.width, calcRect.height);    g.setColor(saved);  }