Index: src/com/jme/app/AbstractGame.java =================================================================== RCS file: /cvs/jme/src/com/jme/app/AbstractGame.java,v retrieving revision 1.35 diff -u -r1.35 AbstractGame.java --- src/com/jme/app/AbstractGame.java 10 Apr 2008 16:08:23 -0000 1.35 +++ src/com/jme/app/AbstractGame.java 15 Apr 2008 02:32:57 -0000 @@ -36,6 +36,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.Stack; +import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Level; import java.util.logging.Logger; @@ -191,22 +192,26 @@ if ((!loaded && dialogBehaviour == FIRSTRUN_OR_NOCONFIGFILE_SHOW_PROPS_DIALOG) || dialogBehaviour == ALWAYS_SHOW_PROPS_DIALOG) { - final LWJGLPropertiesDialog[] dialog = new LWJGLPropertiesDialog[1]; + final AtomicReference dialogRef = new AtomicReference(); final Stack mainThreadTasks = new Stack(); try { - EventQueue.invokeLater(new Runnable() { - public void run() { - dialog[0] = new LWJGLPropertiesDialog(properties, dialogImage, mainThreadTasks); - } - }); + if (EventQueue.isDispatchThread()) { + dialogRef.set(new LWJGLPropertiesDialog(properties, dialogImage, mainThreadTasks)); + } else { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + dialogRef.set(new LWJGLPropertiesDialog(properties, dialogImage, mainThreadTasks)); + } + }); + } } catch (Exception e) { logger.logp(Level.SEVERE, this.getClass().toString(), "LWJGLPropertiesDialog(PropertiesIO, URL)", "Exception", e); return; } - - while (dialog[0] == null || dialog[0].isVisible()) { + final LWJGLPropertiesDialog dialog = dialogRef.get(); + while (dialog == null || dialog.isVisible()) { try { // check worker queue for work while (!mainThreadTasks.isEmpty()) { @@ -219,7 +224,7 @@ } } - if (dialog[0].isCancelled()) { + if (dialog.isCancelled()) { //System.exit(0); finish(); }