public class SunJDK14ConditionalEventPump extends ConditionalEventPump
EventQueue.peekEvent(),
that does not flush pending events to the EventQueue before peeking for them.
The implementation of EventQueue.getNextEvent() calls
SunToolkit.flushPendingEvents() before returning the next event, thus
ensuring that all events are flushed to the EventQueue.
However, the implementation of EventQueue.peekEvent() does not call
SunToolkit.flushPendingEvents() resulting in peekEvents() returning
null (no events available) while getNextEvent() returns not null (a flushed
event).ConditionalEventPump.ThrowableHandler| Constructor and Description |
|---|
SunJDK14ConditionalEventPump() |
| Modifier and Type | Method and Description |
|---|---|
protected AWTEvent |
waitForEvent()
Flushes pending events before waiting for the next event.
|
canPumpEvent, getEventFilter, getEventQueue, peekEvent, pumpEvents, setEventFilterprotected AWTEvent waitForEvent()
EventQueue.getNextEvent()
and EventQueue.peekEvent(): the first always flushes pending events,
the second does not. This missing flushing is the reason why peekEvent() returns null
causing the proxy implementation of Conditional.evaluate() to never returnwaitForEvent in class ConditionalEventPumpCopyright © 2002-2011. All Rights Reserved.