better positioning of dialog on the screen
[instantlauncher.git] / src / main / java / eu / svjatoslav / instantlauncher / MainFrame.java
index 8e3dd3a..cdd351c 100755 (executable)
@@ -2,7 +2,6 @@ package eu.svjatoslav.instantlauncher;
 
 import java.awt.BorderLayout;
 import java.awt.Dimension;
-import java.awt.Point;
 import java.awt.event.WindowEvent;
 import java.awt.event.WindowListener;
 
@@ -12,45 +11,11 @@ import eu.svjatoslav.instantlauncher.menu.MultiLevelMenu;
 
 public class MainFrame {
 
-    public static class FrameWindowListener implements WindowListener {
-
-        @Override
-        public void windowActivated(final WindowEvent e) {
-        }
-
-        @Override
-        public void windowClosed(final WindowEvent e) {
-        }
-
-        @Override
-        public void windowClosing(final WindowEvent e) {
-            InstantLauncher.exitProgram();
-        }
-
-        @Override
-        public void windowDeactivated(final WindowEvent e) {
-        }
-
-        @Override
-        public void windowDeiconified(final WindowEvent e) {
-        }
-
-        @Override
-        public void windowIconified(final WindowEvent e) {
-        }
-
-        @Override
-        public void windowOpened(final WindowEvent e) {
-        }
-
-    }
-
     private JFrame frame;
 
     private boolean isShowing;
 
     public static final Dimension CONTENT_PANEL_SIZE = new Dimension(1100, 850);
-    public static final Point INITIAL_LOCATION = new Point(100, 30);
 
     private final InstantLauncher instantLauncher;
 
@@ -73,20 +38,50 @@ public class MainFrame {
 
             buildContentPane();
 
-            frame.setSize(CONTENT_PANEL_SIZE);
-            frame.setVisible(true);
-            frame.setLocation(INITIAL_LOCATION);
-
             // registor window listener
             final FrameWindowListener windowListener = new FrameWindowListener();
             frame.addWindowListener(windowListener);
 
             // maximize window
             frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
+            frame.setVisible(true);
 
             isShowing = true;
         }
 
     }
 
+    public static class FrameWindowListener implements WindowListener {
+
+        @Override
+        public void windowActivated(final WindowEvent e) {
+        }
+
+        @Override
+        public void windowClosed(final WindowEvent e) {
+        }
+
+        @Override
+        public void windowClosing(final WindowEvent e) {
+            InstantLauncher.exitProgram();
+        }
+
+        @Override
+        public void windowDeactivated(final WindowEvent e) {
+        }
+
+        @Override
+        public void windowDeiconified(final WindowEvent e) {
+        }
+
+        @Override
+        public void windowIconified(final WindowEvent e) {
+        }
+
+        @Override
+        public void windowOpened(final WindowEvent e) {
+        }
+
+    }
+
 }