Show error message outside thread loop
authoramwaterhouse <Andrew Waterhouse>
Fri, 18 Nov 2005 09:59:46 +0000 (09:59 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 18 Nov 2005 09:59:46 +0000 (09:59 +0000)
src/jalview/gui/SequenceFetcher.java

index adadf14..e8f4abf 100755 (executable)
@@ -165,7 +165,7 @@ public class SequenceFetcher
         }\r
       }\r
 \r
-    if (result.length() > 0 && error!=null)\r
+    if (result.length() > 0 && error==null)\r
     {\r
       String format = IdentifyFile.Identify(result.toString(), "Paste");\r
       SequenceI[] sequences = null;\r
@@ -234,17 +234,23 @@ public class SequenceFetcher
       }\r
     }\r
 \r
+    if(error!=null)\r
+          showErrorMessage(error);\r
+\r
     database.setEnabled(true);\r
     textfield.setEnabled(true);\r
     ok.setEnabled(true);\r
     cancel.setEnabled(true);\r
     frame.setTitle("Sequence Fetcher");\r
 \r
-    if(error!=null)\r
-          JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
-         error, "Error Retrieving Data", JOptionPane.WARNING_MESSAGE);\r
 \r
   }\r
+\r
+  void showErrorMessage(String error)\r
+  {\r
+    JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+         error, "Error Retrieving Data", JOptionPane.WARNING_MESSAGE);\r
+  }\r
 }\r
 \r
 \r