I'm writing a game and need a 60 second countdown. I would like it to start counting down when I click the "Start" button. I can get it to countdown manually right now, but need it to do so automatically.
This is a Java Applet, not Javascript.
Is there a way I can have this timer go in the background while I use other buttons? I'm using JLabels and JButtons. Can I have two ActionListeners running at the same time?
Use
javax.swing.Timer
Run this example. You will see that you can still perform other actions while the time is running. Click the yes or no button, while the time is going