I am trying to make a JFrame with a background that changes slowly over time.
here's my code:

```
public class RainbowWindow extends Applet implements ActionListener {

    private static final long serialVersionUID = 1L;

    public void paint(Graphics g) {
        Timer timer = new Timer(1000, this);
        timer.start();
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        Color color = new Color(((int) Math.random()), ((int) Math.random()), ((int) Math.random()), 255);
        setBackground(color);

    }
}

```

but all i get is just a black screen