Content deleted Content added
m →Executing code in the EDT: Add missing space |
|||
Line 3:
== Executing code in the EDT ==
Other application threads can execute code in the event dispatching thread by defining the code in a {{Javadoc:SE|java/lang|Runnable}} object and pass it to the {{Javadoc:SE|javax/swing|SwingUtilities}} helper class or to the {{Javadoc:SE|java/awt|EventQueue}}. Two methods of
Another solution for executing code in the EDT is using the ''[[Worker pattern|worker design pattern]]''. The <code>[[SwingWorker]]</code> class, developed by [[Sun Microsystems]], is an implementation of the worker design pattern, but is not a part of standard Swing distribution. The open source project [http://foxtrot.sourceforge.net/ Foxtrot] provides another synchronous execution solution similar to <code>SwingWorker</code>.
|