Run on the event dispatch thread
If holding the event lock is not appropriate, create a class that implements the Runnable interface. Invoke its run() method on the event dispatch thread by invoking one of the following three methods:
• Invoke invokeAndWait(Runnable) to have run() called on the event dispatch thread immediately. The call blocks until run() completes.
• Invoke invokeLater(Runnable) to have run() called on the event dispatch thread after all pending events are processed.
• Invoke invokeLater(Runnable, long, boolean) to have run() called on the event dispatch thread after a specified amount of time, where time specifies the number of milliseconds to wait before adding Runnable to the event queue. If repeat is true, the Runnable is added to the event queue every time milliseconds.
Post a comment