Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. The event
dispatching thread is a background thread used in Java to process events
from the Abstract Window Toolkit graphical user interface event queue.
These events are primarily update events that cause user interface
components to redraw themselves, or input events from input devices such
as the mouse or keyboard. The AWT uses a single-threaded painting 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 bugs in Java programs
that use Swing. Most AWT and Swing object methods are not thread safe:
invoking them from multiple threads risks thread interference or memory
consistency errors. To avoid these problems, Swing standards states that
all user interface components should be created and accessed only from
the AWT event dispatch thread.