Event dispatching thread: Difference between revisions

Content deleted Content added
mNo edit summary
Line 1:
The '''event dispatching thread''' (EDT) is a background [[Thread (computer science)|thread]] used in [[Java (programming language)|Java]] to process events from the [[Abstract Windowing Toolkit]] (AWT) [[graphical user interface]] [[event queue]]. These events are primarily update events that cause user interface [[Software componentry|components]] to redraw themselves, or input events from [[input device]]s such as the mouse or keyboard. The AWT uses a single-threaded painting [[Model (abstract)|model]] in which all screen updates must be performed from a single thread. The event dispatching thread is the only valid thread to update the visual state of visible user interface components. Updating visible components from other threads is the source of many common [[Software bug|bugs]] in Java [[Computer program|programs]] that use [[Swing (Java)|Swing]] <ref>THis problem is not specific to Java [[Swing (Java)|Swing]]. There is the same issue in most [[Widget toolkit]]s, as for example [[Windows Forms]], where the [[BackgroundWorker]] class performs the same purpose.</ref>.
 
== Executing code in the EDT ==
Line 6:
 
Another solution for executing code in the EDT is using the ''[[SwingWorker|worker design pattern]]''. The <code>[[SwingWorker]]</code> class, developed by [[Sun Microsystems]], is an implementation of the worker design pattern, and as Java 6 is part of standard Swing distribution. The open source project [http://foxtrot.sourceforge.net/ Foxtrot] provides another synchronous execution solution similar to <code>SwingWorker</code>.
 
==References==
</References>
 
== See also ==
Line 14 ⟶ 17:
 
== External links ==
 
* {{Javadoc:SE|package=javax.swing|javax/swing}} (Swing API [[Javadoc]] documentation)
* {{Javadoc:SE|package=java.awt|java/awt}} (AWT API [[Javadoc]] documentation)