Allows an application that has pushed its own
EventQueue implementation to receive
events generated by AWT via that queue's EventQueue.postEvent(java.awt.AWTEvent) method.
By default, events generated by AWT itself enter the bottom-most (root) EventQueue of the system
event queue stack via its EventQueue.postEvent(java.awt.AWTEvent) method, which are then forwarded
to the queues up the stack without calling that method again.
Events posted by user applications via methods like EventQueue.invokeLater(java.lang.Runnable)
are not affected by this API.
-
Method Summary
Modifier and TypeMethodDescriptionsetTargetEventQueue(EventQueue queue) Sets theEventQueue, whichEventQueue.postEvent(java.awt.AWTEvent)method is called for events generated by AWT itself.
-
Method Details
-
setTargetEventQueue
Sets theEventQueue, whichEventQueue.postEvent(java.awt.AWTEvent)method is called for events generated by AWT itself.Upon the return of this method, it is guaranteed that every new AWT event will be posted to the passed event queue via the
EventQueue.postEvent(java.awt.AWTEvent)method. This method may block until the posting of previously generated events completes.queuemust remain on the stack for the duration of it being used as the AWT's target event queue.- Parameters:
queue- new target queue, ornullto restore the default (root) queue- Returns:
- the previous target queue, never
null - Throws:
IllegalArgumentException- if passed queue is not on the system event queue stackIllegalStateException- if the system event queue is not initialized for the calling thread
-