This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Swing InvokeLater ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing InvokeLater ?" Watch "Swing InvokeLater ?" New topic
Author

Swing InvokeLater ?

Jeremy Maddera
Greenhorn

Joined: May 02, 2002
Posts: 16
I am trying to have a waiting dialog appear while the application is retrieving some database information. Once the information is returned the waiting dialog needs to disapper....I have try using SwingUtilities.InvokeLater() but all I get is the Dialog with out an content..The Label waiting does not appear...What am I doing wrong?
Jeremy Maddera
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Could we see some code? How are we to know what you are doing wrong when we can't even see what you are doing?


GenRocket - Experts at Building Test Data
Jeremy Maddera
Greenhorn

Joined: May 02, 2002
Posts: 16
I Guess what I really asking is using invokeLater the right solution..In my reading of Event Thread is that when you will be updating UI from different threads then the proper way to do this with invokeLater and invokeAndWait methods calls...But when I create a runnable object that will display a dialog..I use the invokeLater to start this thread....But the UI Does not update..If I create a Thread object and start the thread that way then all works correctly......Just Confused when to use the InvokeLater and InvokeAndWait methods....
Jeremy Maddera
Greenhorn

Joined: May 02, 2002
Posts: 16
I found a solution on the sun site using the SwingWorker class..
Swing Threading
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Swing InvokeLater ?