The rules governing what needs to be performed on the EDT (I see "EDT" more often used than "Event Queue") have changed during Java's lifetime. And everytime the "rules" changed, Sun advised doing more and more "GUI related" work on the EDT.
Why do people run Java GUI’s on the EDT?
Note, and this is not very well known, that the EDT actually does crash once in a while, because Swing itself has a few bugs. Every non-trivial Swing application is using Swing APIs that have, well, bugs and hence once in a while the EDT dies.
You never see it and it isn't a cause of concerns, because when the EDT dies it is automagically restarted.
Basically, do all GUI-related stuff on the EDT and do all lenghty operations outside the EDT (as to not block the EDT).
EDIT you asked for an example as to how to run a lenghty operation outside the EDT. There are several ways to do this. In the simplest case, you simply create and start a new Thread, from the EDT. Here's one example: the listener callback shall be called when the user clicks on a button, we know that this shall happen on the EDT...
JButton jb = ...
jb.addActionListener( new ActionListener() {
public void actionPerformed( final ActionEvent e ) {
final Thread t = new Thread( new Runnable() {
public void run() {
// this shall get executed, after start() has been called, outside the EDT
}
});
t.start();
}
} );
For more complicated examples, you want to read on SwingWorker, etc.