}\r
else\r
{\r
- String errorMessage = AppletFormatAdapter.SUPPORTED_FORMATS;\r
+ String error = AppletFormatAdapter.SUPPORTED_FORMATS;\r
\r
if (FormatAdapter.isValidFormat(format))\r
{\r
}\r
catch (java.io.IOException ex)\r
{\r
- errorMessage = ex.getMessage();\r
+ error = ex.getMessage();\r
}\r
}\r
\r
if (Desktop.instance != null)\r
Desktop.instance.stopLoading();\r
\r
- JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
- "Couldn't load file " + file +\r
- "\n"\r
- + errorMessage,\r
- "Error loading file",\r
- JOptionPane.WARNING_MESSAGE);\r
+ final String errorMessage = "Couldn't load file "+file+"\n"+error;\r
+\r
+ javax.swing.SwingUtilities.invokeLater(new Runnable()\r
+ {\r
+ public void run()\r
+ {\r
+ JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+ errorMessage,\r
+ "Error loading file",\r
+ JOptionPane.WARNING_MESSAGE);\r
+ }\r
+ });\r
}\r
}\r
\r