From: amwaterhouse Date: Thu, 17 Aug 2006 13:51:56 +0000 (+0000) Subject: OptionPane invokeLater X-Git-Tag: Release_2_1~37 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6ddec2b963d01f867f19976cd5c6aa7d6b2dc88a;p=jalview.git OptionPane invokeLater --- diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index 10e0bf8..ac3c5d3 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -136,7 +136,7 @@ public class FileLoader } else { - String errorMessage = AppletFormatAdapter.SUPPORTED_FORMATS; + String error = AppletFormatAdapter.SUPPORTED_FORMATS; if (FormatAdapter.isValidFormat(format)) { @@ -146,7 +146,7 @@ public class FileLoader } catch (java.io.IOException ex) { - errorMessage = ex.getMessage(); + error = ex.getMessage(); } } @@ -182,12 +182,18 @@ public class FileLoader if (Desktop.instance != null) Desktop.instance.stopLoading(); - JOptionPane.showInternalMessageDialog(Desktop.desktop, - "Couldn't load file " + file + - "\n" - + errorMessage, - "Error loading file", - JOptionPane.WARNING_MESSAGE); + final String errorMessage = "Couldn't load file "+file+"\n"+error; + + javax.swing.SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + JOptionPane.showInternalMessageDialog(Desktop.desktop, + errorMessage, + "Error loading file", + JOptionPane.WARNING_MESSAGE); + } + }); } }