aspose file tools*
The moose likes Threads and Synchronization and the fly likes How do I make the event dispatch thread wait for a worker thread to complete Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "How do I make the event dispatch thread wait for a worker thread to complete" Watch "How do I make the event dispatch thread wait for a worker thread to complete" New topic
Author

How do I make the event dispatch thread wait for a worker thread to complete

Harry Harding
Greenhorn

Joined: Mar 18, 2010
Posts: 5
Hi all,
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.

Any suggestions?

Thanks.
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

I am really not very sure about your question but if you are asking how does you make one thread wait for other then wait/notify or locks/conditions are the things you should look at.

If it is specific to swing then you might be better off asking the moderator here to move this thread to the swing forum


apigee, a better way to API!
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

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...


Steve
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I make the event dispatch thread wait for a worker thread to complete