Use the Swing interface Runnable and Swing utilites method invokeLater to make sure that the GUI is in a thread safe environment.