Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
One of the most valuable features of AWT/Swing modal dialogs is about blocking the current (calling) thread until the dialog is hidden/disposed. It's implemented differently for the calling thread be EDT or any other thread: 1. On EDT, we start a nested message pump so the application doesn't get frozen. 2. On any other thread, we just wait on AWT TreeLock. However, all the code behind this feature is package private, see Dialog.show() for details. Many external developers, as well as internal projects like Swing and Java Plugin, need this functionality: stop the current thread until a certain condition is met - both for EDT and non-EDT threads.
|