g.fillRect(x, y, w, h);
switch (tabPlacement) { case SwingConstants.TOP: g.fillRect(x + 1, y + 1, w - 1, h - 1); break; case SwingConstants.BOTTOM: g.fillRect(x, y, w - 1, h - 1); break; case SwingConstants.LEFT: g.fillRect(x + 1, y + 1, w - 1, h - 2); break; case SwingConstants.RIGHT: g.fillRect(x, y + 1, w - 1, h - 2); break; }
  protected void paintTabBackground(Graphics g, int tabPlacement,                                    int tabIndex, int x, int y, int w, int h,                                    boolean isSelected)  {    Color saved = g.getColor();    if (isSelected)      g.setColor(Color.LIGHT_GRAY);    else      {        Color bg = tabPane.getBackgroundAt(tabIndex);        if (bg == null)          bg = Color.GRAY;        g.setColor(bg);      }    g.fillRect(x, y, w, h);    g.setColor(saved);  }