aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How EventDispatchThread starts a new thread ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How EventDispatchThread starts a new thread ?" Watch "How EventDispatchThread starts a new thread ?" New topic
Author

How EventDispatchThread starts a new thread ?

Mohit J Kumar
Ranch Hand

Joined: Apr 08, 2010
Posts: 33


Usually we call start() to start the execution of a thread but in Swing (code above) there is no such call.
How EDT starts the thread execution ???

Thanks


"It's good to B in touch...So keep responding"
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

How EDT starts the thread execution ???

You have this wrong. Read the documentation. SwingUtilities#invokeLater (or invokeAndWait) doesn't start* a new thread. What it does is this:
Causes doRun.run() to be executed asynchronously on the AWT event dispatching thread.


* If and only if the EDT isn't already started, then the call to this method will result in launching the EDT. That's not anything a client program has to concern itself with.


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How EventDispatchThread starts a new thread ?