]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
singleton of Database & FirstPanel
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / FirstPanel.java
index d0f9151ed7fe613b7ef2f1c134559d610884aa27..c78ad97bb3063604bd7554a02f42fea43f1a8b8c 100644 (file)
@@ -24,6 +24,8 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
         */\r
        private static final long serialVersionUID = 207759413522910399L;\r
        \r
+       private static final FirstPanel INSTANCE = FirstPanel.init();\r
+       \r
        private String startpath;\r
        private ModuleInfo mi;\r
        \r
@@ -36,7 +38,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
        private boolean tofile = true, toscreen = true;\r
        private PrintWriter logfile;\r
 \r
-       FirstPanel() throws Exception {\r
+       FirstPanel() {\r
         GridBagLayout gridbag = new GridBagLayout();\r
         setLayout(gridbag);\r
         \r
@@ -235,14 +237,17 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
 \r
     //---------------------------------------------------------------------------------------//\r
     \r
-    public static FirstPanel init() throws Exception {\r
-       \r
-       //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());\r
-       UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r
-       //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");\r
-       //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");\r
-       //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");\r
-       //UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");\r
+    private static final FirstPanel init() {\r
+       try {\r
+               UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r
+               //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());\r
+               //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");\r
+               //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");\r
+               //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");\r
+               //UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");\r
+       } catch (Exception e) {\r
+               System.out.println(e.getMessage());\r
+       }\r
        \r
                JFrame frame = new JFrame("MigrationTools");\r
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r
@@ -258,4 +263,8 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
                \r
                return fp;\r
     }\r
+    \r
+    public static final FirstPanel getInstance() {\r
+       return INSTANCE;\r
+    }\r
 }
\ No newline at end of file