src/share/classes/java/awt/Container.java
Print this page
*** 2897,2917 ****
else {
nativeContainer.modalComp = this;
}
}
! Runnable pumpEventsForHierarchy = new Runnable() {
! public void run() {
! EventDispatchThread dispatchThread =
! (EventDispatchThread)Thread.currentThread();
! dispatchThread.pumpEventsForHierarchy(
! new Conditional() {
! public boolean evaluate() {
! return ((windowClosingException == null) && (nativeContainer.modalComp != null)) ;
! }
! }, Container.this);
! }
};
if (EventQueue.isDispatchThread()) {
SequencedEvent currentSequencedEvent =
KeyboardFocusManager.getCurrentKeyboardFocusManager().
--- 2897,2910 ----
else {
nativeContainer.modalComp = this;
}
}
! Runnable pumpEventsForHierarchy = () -> {
! EventDispatchThread dispatchThread = (EventDispatchThread)Thread.currentThread();
! dispatchThread.pumpEventsForHierarchy(() -> nativeContainer.modalComp != null,
! Container.this);
};
if (EventQueue.isDispatchThread()) {
SequencedEvent currentSequencedEvent =
KeyboardFocusManager.getCurrentKeyboardFocusManager().
*** 2925,2949 ****
synchronized (getTreeLock()) {
Toolkit.getEventQueue().
postEvent(new PeerEvent(this,
pumpEventsForHierarchy,
PeerEvent.PRIORITY_EVENT));
! while ((windowClosingException == null) &&
! (nativeContainer.modalComp != null))
{
try {
getTreeLock().wait();
} catch (InterruptedException e) {
break;
}
}
}
}
- if (windowClosingException != null) {
- windowClosingException.fillInStackTrace();
- throw windowClosingException;
- }
if (predictedFocusOwner != null) {
KeyboardFocusManager.getCurrentKeyboardFocusManager().
dequeueKeyEvents(time, predictedFocusOwner);
}
}
--- 2918,2937 ----
synchronized (getTreeLock()) {
Toolkit.getEventQueue().
postEvent(new PeerEvent(this,
pumpEventsForHierarchy,
PeerEvent.PRIORITY_EVENT));
! while (nativeContainer.modalComp != null)
{
try {
getTreeLock().wait();
} catch (InterruptedException e) {
break;
}
}
}
}
if (predictedFocusOwner != null) {
KeyboardFocusManager.getCurrentKeyboardFocusManager().
dequeueKeyEvents(time, predictedFocusOwner);
}
}