int x = contentRect.x; int y = contentRect.y; int w = contentRect.width; int h = contentRect.height;
int width = tabPane.getWidth(); int height = tabPane.getHeight(); Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement);   int x = insets.left; int y = insets.top; int w = width - insets.left - insets.right; int h = height - insets.top - insets.bottom;  switch (tabPlacement) { case LEFT: x += calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); w -= (x - insets.left); break; case RIGHT: w -= calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); break; case BOTTOM: h -= calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); break; case TOP: default: y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); h -= (y - insets.top); }   if (tabPane.isOpaque()) { Color bg = UIManager.getColor("TabbedPane.contentAreaColor"); g.setColor(bg); g.fillRect(x, y, w, h); }
  protected void paintContentBorder(Graphics g, int tabPlacement,                                    int selectedIndex)  {    int x = contentRect.x;    int y = contentRect.y;    int w = contentRect.width;    int h = contentRect.height;    paintContentBorderTopEdge(g, tabPlacement, selectedIndex, x, y, w, h);    paintContentBorderLeftEdge(g, tabPlacement, selectedIndex, x, y, w, h);    paintContentBorderBottomEdge(g, tabPlacement, selectedIndex, x, y, w, h);    paintContentBorderRightEdge(g, tabPlacement, selectedIndex, x, y, w, h);  }