Commits

John Eriksson committed 600958e

SimaManager now uses javax.swing.SwingUtilities.invokeLater to execute GUI code in the AWT event dispatch thread

Comments (0)

Files changed (1)

src/se/kth/csc/sima/SimaManager.java

 
 public class SimaManager {
 
-    public static void main(String[] args) {
-        
-        String server;
-        if ((server = System.getProperty("sima_server")) == null) {
-            System.err.println("Run as: java -Dsima_server=<server_address> [-Ddebug] SimaManager");
-            System.exit(1);
-        }
-
+    private static void setupManager(String server) {
         try {
             UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
         } catch (Exception e) {
         sw.display();
     }
 
+    public static void main(String[] args) {
+
+        String server;
+        if ((server = System.getProperty("sima_server")) == null) {
+            System.err.println("Run as: java -Dsima_server=<server_address> [-Ddebug] SimaManager");
+            System.exit(1);
+        }
+        final String serverf = server;
+        javax.swing.SwingUtilities.invokeLater(new Runnable() {
+
+            @Override
+            public void run() {
+                setupManager(serverf);
+            }
+        });
+    }
 }