g.setColor(MetalLookAndFeel.getControlShadow());
{   Color background = UIManager.getColor("TabbedPane.unselectedBackground"); if (background == null) background = UIManager.getColor("TabbedPane.background"); g.setColor(background); }
  protected void paintTabBackground(Graphics g, int tabPlacement,      int tabIndex, int x, int y, int w, int h, boolean isSelected)  {    if (isSelected)      g.setColor(MetalLookAndFeel.getControl());    else      g.setColor(MetalLookAndFeel.getControlShadow());    int[] px, py;    if (tabPlacement == TOP)       {        px = new int[] {x + 6, x + w - 1, x + w -1, x + 2, x + 2};        py = new int[] {y + 2, y + 2, y + h - 1, y + h -1, y + 6};      }    else if (tabPlacement == LEFT)      {        px = new int[] {x + 6, x + w - 1, x + w -1, x + 2, x + 2};        py = new int[] {y + 2, y + 2, y + h - 1, y + h -1, y + 6};      }    else if (tabPlacement == BOTTOM)      {        px = new int[] {x + 2, x + w - 1, x + w -1, x + 8, x + 2};        py = new int[] {y, y, y + h - 1, y + h -1, y + h - 7};      }    else if (tabPlacement == RIGHT)      {        px = new int[] {x + 2, x + w - 7, x + w - 1, x + w - 1, x + 2};        py = new int[] {y + 2, y + 2, y + 7, y + h -1, y + h - 1};      }    else       throw new AssertionError("Unrecognised 'tabPlacement' argument.");    g.fillPolygon(px, py, 5);  }