File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Event Dispatch Thread - Swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Event Dispatch Thread - Swing" Watch "Event Dispatch Thread - Swing" New topic
Author

Event Dispatch Thread - Swing

Mike Grandmaison
Greenhorn

Joined: Apr 14, 2004
Posts: 12
I've been trying to figure out exactly what the deal is with the event dispatch thread but a lot of the tutorials are't crystal clear on it.

One says that after you have called x.show() you should not do anymore gui calls. I am guess this is because x.show() hands x the event dispatch thread?

So my question is, I have an actionlistener which gets called when a button is pressed, - book action -, now this actionlisterner creates a confirmdialog and says confirmdialog.show(). The app is then basically waiting for the user to confirm they want to book the room. When the option is selected the line after .show() says if option=1 then book. Now since I have already called show in this method would it be wrong for me to create another dialog and say booking confirmed?

or since the show method has to return in order for this method to continue can I assume that it does have the event dispatch thread and it is safe to call another show method?

Thanks for any clarification.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Event Dispatch Thread - Swing
 
Similar Threads
synchronization in a loop
Animation Applet
Wait in Java
Issue regarding Glass Pane
Why InvokeLater