@Override
    protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex ) 
    {
        int width = tabPane.getWidth();
        int height = tabPane.getHeight();
        Insets insets = tabPane.getInsets();      

       int x = insets.left;
       int y = insets.top;
       int w = width - insets.right - insets.left;
       int h = height - insets.top - insets.bottom;

        switch(tabPlacement) 
        {
           case LEFT:
              x += calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth);              
              x -= tabAreaInsets.right;              
              w -= (x - insets.left);
              break;
          case RIGHT:
              w -= calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth);              
              w += tabAreaInsets.left;              
              break;
          case BOTTOM:
              h -= calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight);              
              h += tabAreaInsets.top;
              break;
          case TOP:
          default:
              y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight);              
              y -= tabAreaInsets.bottom;              
              h -= (y - insets.top);
        }
            
        if ( tabPane.getTabCount() > 0  )                
        {            
           Color color = UIManager.getColor("TabbedPane.contentAreaColor");
           if (color != null) {
               g.setColor(color);
           }
           else if ( colorContentBorder == null || selectedIndex == -1 ) {
               g.setColor(tabPane.getBackground());
           }
           else {
               g.setColor(colorContentBorder);
           }
           g.fillRect(x,y,w,h);
        }
    }