Is a new Thread created when Runnable开发者_如何学Go is used with SwingUtilities.invokeAndWait()
?
No,a new thread is not created when Runnable is used with SwingUtilities.invokeAndWait()
.
The Event Thread will end up calling the run() method of the Runnable when it's turn comes up on
the event queue.
invokeAndWait API.
Causes doRun.run() to be executed synchronously on the AWT event dispatching thread
No. The purpose of the method is to run the Runnable on the GUI event thread, which I would assume you have already.
In short, no. The current thread blocks until the EventQueue runs the Runnable.
Causes doRun.run() to be executed synchronously on the AWT event dispatching thread.
no it triggers an event on the AWT event thread (which is already running in gui apps)
精彩评论