Does it go away and a new one comes immediately?
To keep the Timer from continuing to call the listener, stop or cancel it.
Type: Posts; User: Norm
Does it go away and a new one comes immediately?
To keep the Timer from continuing to call the listener, stop or cancel it.
Sorry, that's a message from the IDE, but it hides what the compiler error is. You need to try another way to get the compiler's error message.
The code in post#5 shows a call to the JOptionPane method inside an if.
if (count ==0){
JOptionPane.showMessageDialog(null, "You loose",...
What happened when you tried as in post#5?
What happened when you used that code?
What line of code is changing the value of the "timer"?
++ means to add 1
-- means to subtract 1
The Timer will call your listener code at the frequency/interval that the code sets.
You can have that code do whatever you need done when it is called.
If you want to see when the listener is...