JDK-6949936 : Provide API for running nested events loops, similar to what modal dialogs do
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.2.2,7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-05-05
  • Updated: 2017-05-16
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b112Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
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.

Comments
EVALUATION We should try to provide some kind of public API, so it can be safely used by all the applications, not within JDK only. That is, some java.awt public classes or methods, not sun.awt.* ones.
05-05-2010