|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.EventQueue
EventQueue is a platform-independent class that queues events, both from the underlying peer classes and from trusted application classes.
Some browsers partition applets in different code bases into separate contexts, and establish walls between these contexts. In such a scenario, there will be one EventQueue per context. Other browsers place all applets into the same context, implying that there will be only a single, global EventQueue for all applets. This behavior is implementation-dependent. Consult your browser's documentation for more information.
Constructor Summary | |
EventQueue()
|
Method Summary | |
protected void |
dispatchEvent(AWTEvent event)
Dispatch an event. |
AWTEvent |
getNextEvent()
Remove an event from the EventQueue and return it. |
static void |
invokeAndWait(Runnable runnable)
Causes runnable to have its run() method called in the dispatch thread of the EventQueue. |
static void |
invokeLater(Runnable runnable)
Causes runnable to have its run() method called in the dispatch thread of the EventQueue. |
static boolean |
isDispatchThread()
Returns true if the calling thread is the current AWT EventQueue's dispatch thread. |
AWTEvent |
peekEvent()
Return the first event on the EventQueue without removing it. |
AWTEvent |
peekEvent(int id)
Return the first event with the specified id, if any. |
protected void |
pop()
Stop dispatching events using this EventQueue instance. |
void |
postEvent(AWTEvent theEvent)
Post a 1.1-style event to the EventQueue. |
void |
push(EventQueue newEventQueue)
Replace the existing EventQueue with the specified one. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EventQueue()
Method Detail |
public void postEvent(AWTEvent theEvent)
theEvent
- an instance of java.awt.AWTEvent, or a
subclass of it.public AWTEvent getNextEvent() throws InterruptedException
InterruptedException
- if another thread has interrupted this thread.public AWTEvent peekEvent()
public AWTEvent peekEvent(int id)
id
- the id of the type of event desired.protected void dispatchEvent(AWTEvent event)
Event Type | Source Type | Dispatched To |
---|---|---|
ActiveEvent | Any | event.dispatch() |
Other | Component | source.dispatchEvent(AWTEvent) |
Other | MenuComponent | source.dispatchEvent(AWTEvent) |
Other | Other | No action (ignored) |
theEvent
- an instance of java.awt.AWTEvent, or a
subclass of it.public void push(EventQueue newEventQueue)
an
- EventQueue (or subclass thereof) instance to be used.pop()
protected void pop() throws EmptyStackException
if
- no previous push was made on this EventQueue.push(java.awt.EventQueue)
public static boolean isDispatchThread()
public static void invokeLater(Runnable runnable)
runnable
- the Runnable whose run() method should be executed
synchronously on the EventQueueinvokeAndWait(java.lang.Runnable)
public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException
runnable
- the Runnable whose run() method should be executed
synchronously on the EventQueueInterruptedException
- if another thread has
interrupted this threadInvocationTargetException
- if an exception is thrown
when running runnableinvokeLater(java.lang.Runnable)
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Oracle and/or its affiliates, in the US and other countries.
Copyright © 1995, 2010 Oracle and/or its affiliates. All rights reserved.