showInternalMessage jdk1.5 bug
authoramwaterhouse <Andrew Waterhouse>
Thu, 13 Apr 2006 13:28:42 +0000 (13:28 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 13 Apr 2006 13:28:42 +0000 (13:28 +0000)
src/jalview/gui/AlignViewport.java
src/jalview/gui/SequenceFetcher.java

index 3509217..5b5b1f3 100755 (executable)
@@ -317,12 +317,19 @@ public class AlignViewport
       }\r
       catch (OutOfMemoryError error)\r
       {\r
-        javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
-            "Out of memory calculating conservation!!"\r
-            +\r
-            "\nSee help files for increasing Java Virtual Machine memory."\r
-            , "Out of memory",\r
-            javax.swing.JOptionPane.WARNING_MESSAGE);\r
+        javax.swing.SwingUtilities.invokeLater(new Runnable()\r
+        {\r
+          public void run()\r
+          {\r
+            javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+                "Out of memory calculating conservation!!"\r
+                +\r
+                "\nSee help files for increasing Java Virtual Machine memory."\r
+                , "Out of memory",\r
+                javax.swing.JOptionPane.WARNING_MESSAGE);\r
+          }\r
+        });\r
+\r
         System.out.println("Conservation calculation: " + error);\r
         System.gc();\r
 \r
@@ -402,12 +409,20 @@ public class AlignViewport
 \r
       }catch(OutOfMemoryError error)\r
       {\r
-        javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
-            "Out of memory calculating consensus!!"\r
-            +\r
-            "\nSee help files for increasing Java Virtual Machine memory."\r
-            , "Out of memory",\r
-            javax.swing.JOptionPane.WARNING_MESSAGE);\r
+        javax.swing.SwingUtilities.invokeLater(new Runnable()\r
+        {\r
+          public void run()\r
+          {\r
+            javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+                "Out of memory calc45ulating consensus!!"\r
+                +\r
+                "\nSee help files for increasing Java Virtual Machine memory."\r
+                , "Out of memory",\r
+                javax.swing.JOptionPane.WARNING_MESSAGE);\r
+          }\r
+        });\r
+\r
+\r
         System.out.println("Consensus calculation: " + error);\r
         System.gc();\r
       }\r
index fc8f042..7b25531 100755 (executable)
@@ -460,13 +460,18 @@ public class SequenceFetcher
 \r
   }\r
 \r
-  void showErrorMessage(String error)\r
+  void showErrorMessage(final String error)\r
   {\r
     resetDialog();\r
-    JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
-                                          error, "Error Retrieving Data",\r
+    javax.swing.SwingUtilities.invokeLater(new Runnable()\r
+    {\r
+      public void run()\r
+      {\r
+        JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+                                              error, "Error Retrieving Data",\r
                                           JOptionPane.WARNING_MESSAGE);\r
-    return;\r
+      }\r
+    });\r
   }\r
 }\r
 \r