@Override
    protected void paintTabBackground(Graphics g, int tabPlacement,
                                      int tabIndex, int x, int y, int w, int h,
                                      boolean isSelected) {
        BufferedImage background;
        BufferedImage end;
        Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING , RenderingHints.VALUE_ANTIALIAS_ON);
    
        if (isSelected) {
            if (tabPressed == tabIndex) {
                background = tabSelectedPressed;
                end = tabSelectedPressedEnd;
            } else {
                background = tabSelected;
                end = tabSelectedEnd;
            }
        } else {
            if (getRolloverTab() == tabIndex) {
                background = tabRollover;
                end = tabRolloverEnd;
            } else {
                background = tab;
                end = tabEnd;
            }
        }

        if (x < 0) {
            x = 0;
        }

        if (y < 0) {
            y = 0;
        }
//System.out.println("Width"+TAB_WIDTH);
        g2d.drawImage(background, x, y, TAB_WIDTH, 25, null);
        g2d.drawLine(end.getWidth(), x + TAB_WIDTH - end.getWidth(),end.getWidth(),25);
       g2d.drawImage(end, x + TAB_WIDTH - end.getWidth(), 25, null);
    }