Dont use addToDesktop for splashscreen
authoramwaterhouse <Andrew Waterhouse>
Mon, 17 Jan 2005 16:03:28 +0000 (16:03 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 17 Jan 2005 16:03:28 +0000 (16:03 +0000)
src/jalview/gui/Desktop.java

index feb1e00..ad7cb84 100755 (executable)
@@ -22,7 +22,6 @@ public class Desktop extends jalview.jbgui.GDesktop
   public static JDesktopPane desktop;\r
   static int openFrameCount = 0;\r
   static final int xOffset = 30, yOffset = 30;\r
-  static boolean splashScreenVisible = false;\r
 \r
   public Desktop()\r
   {\r
@@ -65,23 +64,29 @@ public class Desktop extends jalview.jbgui.GDesktop
 \r
     SplashScreen splash = new SplashScreen(frame, image);\r
     frame.setContentPane(splash);\r
-    addInternalFrame(frame, "",845,200);\r
-    splashScreenVisible = true;\r
-\r
+    desktop.add(frame);\r
+    frame.setVisible(true);\r
+    openFrameCount++;\r
+    try\r
+    {\r
+      frame.setSelected(true);\r
+    }\r
+    catch (java.beans.PropertyVetoException e)\r
+    {}\r
+    frame.setResizable(true);\r
+    frame.setSize(845, 200);\r
     frame.setLocation( (int)((getWidth()-845) /2), (int)((getHeight()-240) /2));\r
     frame.setClosable(false);\r
     frame.setIconifiable(false);\r
     frame.setMaximizable(false);\r
     frame.setFrameIcon(null);\r
-    splashScreenVisible = false;\r
 \r
   }\r
 \r
   public static void addInternalFrame(final JInternalFrame frame, String title, int w, int h)\r
   {\r
-   if(!splashScreenVisible)\r
-      frame.setVisible(true); //necessary as of 1.3\r
    desktop.add(frame);\r
+   frame.setVisible(true);\r
    openFrameCount++;\r
    try {\r
        frame.setSelected(true);\r
@@ -100,6 +105,7 @@ public class Desktop extends jalview.jbgui.GDesktop
                                      {\r
                                        openFrameCount--;\r
                                        windowMenu.remove(menuItem);\r
+                                       System.out.println(openFrameCount);\r
                                      };\r
                                    });\r
 \r