responsive. Otherwise, the message loop is blocked and GUI freezing is experienced. Submitting user code to the EDT There are various solutions for submitting code to the EDT and performing lengthy tasks without blocking the loop. Component Event Handlers (Listeners) GUI components support the lists of callbacks, called Listeners, which are typically populated when the components are created. EDT executes the listeners when user excitates the components somehow (button is clicked, mouse is moved, item is selected, focus is lost, component resized and so on.) Timer For short tasks that must access/modify GUI periodically or at specific time, javax.swing.Timer is used. It can be considered as an invisible GUI component, whose listeners are registered to fire at specific time(s). Equivalents System.Windows.Forms.Timer - .NET Framework flash.utils.Timer - Adobe Flash Requests from other threads Other application threads can pass some code to be executed in the event dispatching thread by means of helper classes (or if you are doing AWT). The submitted code must be wrapped with a object. Two methods of these classes allow: synchronous code execution ( or ) and asynchronous code execution ( or ) from the event dispatching thread. The method invokeAndWait() should never be called from the event dispatching thread—it will throw an exception. The method or can be called to determine if the current thread is the event dispatching thread. The code supplied by means of the invokeLater and invokeAndWait to the EDT must be as quick as possible to prevent freezing. They are normally intended to deliver the result of a lengthy computation to the GUI (user). Worker design pattern Both execution of a task in another thread and presenting the results in the EDT can be combined by means of worker design pattern. The javax.swing.SwingWorker class, developed by Sun Microsystems, is an implementation of the worker design pattern, and as of Java 6 is part of standard Swing distribution. SwingWorker is normally invoked from EDT-executed event Listener to perform a lengthy task in order not to block the EDT. Samples SwingWorker<Document, Void> worker = new SwingWorker<Document, Void>() { public Document doInBackground() throws IOException { return loadXML(); // heavy task } public void done() { try { Document doc = get(); display(doc); } catch (Exception ex) { ex.printStackTrace(); } } }; worker.execute(); If you use Groovy and groovy.swing.SwingBuilder, you can use doLater(), doOutside(), and edt(). Then you can write it more simply like this: doOutside