protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) {
        Polygon shape = new Polygon();

        shape.addPoint(x - (h / 4), y + h);
        shape.addPoint(x + (h / 4), y);
        shape.addPoint(x + w - (h / 4), y);

        if (isSelected || (tabIndex == (rects.length - 1))) {
            if (isSelected) {
                g.setColor(selectedColor);
            } else {
                g.setColor(unselectedColor);
            }
            shape.addPoint(x + w + (h / 4), y + h);
        } else {
            g.setColor(unselectedColor);
            shape.addPoint(x + w, y + (h / 2));
            shape.addPoint(x + w - (h / 4), y + h);
        }

        g.fillPolygon(shape);
    }