Interface AsyncChangeHandler

All Known Implementing Classes:

public interface AsyncChangeHandler

Method Summary
 void invokeLater(java.lang.Runnable doRun)
          Causes to be executed asynchronously on the AWT event dispatching thread.
 boolean isDispatchThread()

Method Detail


public void invokeLater(java.lang.Runnable doRun)
Causes to be executed asynchronously on the AWT event dispatching thread. This will happen after all pending AWT events have been processed. This method should be used when an application thread needs to update the GUI. In the following example the invokeLater call queues the Runnable object doHelloWorld on the event dispatching thread and then prints a message.
 Runnable doHelloWorld = new Runnable() {
     public void run() {
         System.out.println("Hello World on " + Thread.currentThread());

 System.out.println("This might well be displayed before the other message.");
If invokeLater is called from the event dispatching thread -- for example, from a JButton's ActionListener -- the will still be deferred until all pending events have been processed. Note that if the throws an uncaught exception the event dispatching thread will unwind (not the current thread).

Additional documentation and examples for this method can be found in How to Use Threads, in The Java Tutorial.

As of 1.3 this method is just a cover for java.awt.EventQueue.invokeLater().

See Also:


public boolean isDispatchThread()

X-Smiles 1.2