watwatacrazy wrote:I am in no way condoning this idea, because as mentioned it is a very bad idea.
What is an alternate to thread.sleep? The reason being, my action listener won't let me throw exceptions so I need an alternative to thread.sleep, anything?
watwatacrazy wrote:It's not that you'd never need Thread.sleep() in a GUI application, it's that you should never be putting blocking code in the thread that keeps the GUI responsive. In fact, the biggest justification to having a dedicated GUI-event-processing-thread is that it allows you to block (or perform CPU-intensive operations) in other threads, without having to worry too much about it locking up the GUI.
why would you ever need thread.sleep in a GUI, I guess you wouldn't.
watwatacrazy wrote:Hm, I'm not sure I agree with this. My way of thinking is that it is fine to use Thread.sleep in a GUI as long as it's done in a background thread. You should never do it on the EDT.
I came back to this and I guess I was thinking straight. Thus, you can use thread.sleep in a GUI using a try and catch but as stated before its not exactly a good idea.