@Override
    public void paint(Graphics g) {
        Graphics2D g2d = (Graphics2D) g;
        g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        int w = getWidth();
        int h = getHeight();
        g2d.setColor(Color.black);
        g2d.fillRect(0, 0, w, h);
        super.paint(g);
        h /= 4;
        Color color2 = new Color(0.0f, 0.0f, 0.0f, 0.0f);
        Color color1 = new Color(0.0f, 0.0f, 0.0f, 1.0f);
        GradientPaint gp = new GradientPaint(0, 0, color1, 0, h, color2);
        g2d.setPaint(gp);
        g2d.fillRect(0, 0, w, h);
        color2 = new Color(0.0f, 0.0f, 0.0f, 1.0f);
        color1 = new Color(0.0f, 0.0f, 0.0f, 0.0f);
        h = g2d.getFontMetrics().getHeight();
        gp = new GradientPaint(0, getHeight()-h*2, color1, 0, getHeight()-h, color2);
        g2d.setPaint(gp);
        g2d.fillRect(0,  getHeight()-h*2, w,  h*2);
    }