I am trying to make a code that makes a random point cloud that changes every five seconds for a minute. I have it so that it makes the inital cloud, but I am stuck on how to make it change every five seconds.
private class newCloud implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
points.clear();
Point p;
Random generator = new Random();
for (int i = 0; i < 100; i++)
{
int x = generator.nextInt(300)+100;
int y = generator.nextInt(200)+100;
if(i % 1 == 0)
{
p = new Point(x,y);
points.add(p);
repaint();
}
}
}
}