Skip to content

Swing EDT (Event Dispatcher Thread)

February 19, 2012

Access to a (visible) Swing component has to occur in the event dispatch thread.

EDT violation: All rendering should happen on the EDT thread at all times.
EDT protection: We should not dump application logic on the EDT. Avoid long lasting tasks on EDT

Swing Worker
Event Dispatcher Queue
SwingUtilities
invokeLater
assert EventQueue.isDispatchThread();
SwingUtilities.invokeAndWait()

We should believe that a “good” Swing widget would support:
proper layout handling
threading
data-binding
focus management
keyboard control
error handling
persistent preferences
pluggable look and feels
accessibility
Dnd+Clipboard
keyboard shortcuts
internationalization

Advertisements

From → java

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: