changeset 50:3431ab41f067

Main: Add initial window from event dispatching thread As recommended by Java 7 documentation.
author Fox
date Tue, 08 Nov 2022 13:58:42 +0100
parents a7df71cc80d9
children da84f5a332f0
files src/junotu/Main.java
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/junotu/Main.java	Tue Nov 08 12:22:32 2022 +0100
+++ b/src/junotu/Main.java	Tue Nov 08 13:58:42 2022 +0100
@@ -2,6 +2,8 @@
 
 import java.lang.RuntimeException;
 
+import javax.swing.SwingUtilities;
+
 import junotu.Database;
 import junotu.Window;
 import junotu.Window.Tab;
@@ -17,8 +19,16 @@
     public static void main(String[] args) throws Exception
     {
 	database = new Database();
-        //windowAdd( Tab.SEARCH );
-        windowAdd( Tab.COLUMNS );
+	
+	SwingUtilities.invokeLater(
+            new Runnable() {
+                public void run()
+                {
+                    //windowAdd( Tab.SEARCH );
+                    windowAdd( Tab.COLUMNS );
+                }
+            }
+        );
     }
 
     public static void windowAdd( Tab tab )