How could I create a timer that is compatible in a JFrane/JPanel oriented program where it just waits 1 second, and then continues on with the rest of the code?
I do not want to use Thread.sleep(); since it is causing problems for me.
For this kind of tasks you can use javax.swing.Timer. It integrates with the Event Dispatching Thread (EDT).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With