This week's giveaways are in the MongoDB and Jobs Discussion forums. We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line! See this thread and this one for details.
How do I make the event dispatch thread wait for a worker thread to complete
Joined: Mar 18, 2010
Hopefully this is the right forum for this question.
I have a Swing application that has several longer running IO ops it needs to do. I've thrown those ops into their own threads since I want to show a wait cursor and a progress bar to the user. I don't, however want the application to do any more work until the IO op is complete. I need the GUI to stay alive and responsive to update the progress bar.
Agreed, this question is more about disabling swing components, rather than making a Thread wait. Because you want a responsive GUI you actually do not want to make the dispatch thread wait. You really just want to disable user interaction. There are probably a number of ways to do that (such as calling the setEnabled(false) method on the components you want to block, or maybe removing/replacing action listeners or something) but I don't know the best/recommended way...