-
Thread Situation
I'm using the JDK 1.0.2 to create applets that all browsers can run. What I need to do is open a dialog box and have the current thread wait until the dialog box closes. The dialog box requires input before it closes.
My real problem is that the current thread happens to be the AWT event handler thread. So if I try any wait()ing or notify()ing or suspend()ing, then it will lock up the thread and there will be no way of receiving any input.
Simply put, how can I do this without affecting the AWT thread?
Thanks.
-
Re: Thread Situation
You need to implement a "Worker" thread. See this tutorial
http://web2.java.sun.com/docs/books/...c/threads.html
It's more about the newer versions of Swing, but the concept will be the same for you.
Basically, you need a separate thread to control your application. This will free up the AWT thread to continue painting and handling input.
Good luck!
-
Re: Thread Situation