So when the user presses my JButton, it picks a random time, and after that time, it will draw a oval to the screen. However, with what I have now, it draws the oval right after the button is pressed. I want it to appear after a random time.
public void actionPerformed(ActionEvent e)
{
if (e.getSource() == startButton)
{
popUpTime = random.nextInt(5000);
timer = new Timer(popUpTime, this);
x = random.nextInt(400) + 70;
y = random.nextInt(400) + 100;
points[current++] = new Point(x, y);
timer.start();
start();
repaint();
}
}