@Override
    public void paint(Graphics g, JComponent c) {
        int tabPlacement = tabPane.getTabPlacement();
    Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING , RenderingHints.VALUE_ANTIALIAS_ON);
    	
        Insets insets = c.getInsets();
        Dimension size = c.getSize();

        if (tabPane.getTabPlacement() == TOP) {
            g2d.drawImage(tab, insets.left, insets.top,
                        size.width - insets.right - insets.left,
                        calculateTabAreaHeight(tabPlacement, runCount,
                                               maxTabHeight),
                        null);
        }
       /*System.out.println("Tab Height"+calculateTabAreaHeight(tabPlacement, runCount,
               maxTabHeight));*/
        super.paint(g2d, c);
    }