public void paint(Graphics g)
    {
        super.paint(g);

        Graphics2D g2d = (Graphics2D) g;
        g2d.setColor(Color.BLUE);

        for (int i = 1; i <= 10; i++) {
            g2d.setComposite(AlphaComposite.getInstance(
                    AlphaComposite.SRC_OVER, i * 0.1f));
            g2d.fillRect(50 * i, 20, 40, 40);
        }
    }