remove two menus, get app to quit when window closes
authoradam <adam@megacz.com>
Wed, 28 Jan 2009 21:10:27 +0000 (13:10 -0800)
committeradam <adam@megacz.com>
Wed, 28 Jan 2009 21:10:27 +0000 (13:10 -0800)
darcs-hash:20090128211027-5007d-de270916e65840b774542363f1380d4402fdebcb.gz

src/edu/berkeley/qfat/Main.java

index 4ae3a8e..3d0b0e4 100644 (file)
@@ -921,8 +921,8 @@ public class Main extends InteractiveMeshViewer {
 
             // Finally, add all the menus to the menu bar.
             add(tileMenu);
-            add(goalMenu);
-            add(hideMenu);
+            //add(goalMenu);
+            //add(hideMenu);
         }
 
     }
@@ -1085,11 +1085,27 @@ public class Main extends InteractiveMeshViewer {
         f.setLayout(new BorderLayout());
         Main main = new Main(f);
         f.add(main, BorderLayout.CENTER);
-        f.setJMenuBar(main.new MyMenuBar());
+
+        f.addWindowListener(new WindowListener() {
+                public void windowActivated(WindowEvent e) { }
+                public void windowClosed(WindowEvent e) { System.exit(0); }
+                public void windowClosing(WindowEvent e) { System.exit(0); }
+                public void windowDeactivated(WindowEvent e)  { }
+                public void windowDeiconified(WindowEvent e)  { }
+                public void windowIconified(WindowEvent e)  { }
+                public void windowOpened(WindowEvent e) { }
+            });
+
         f.pack();
         f.show();
         f.setSize(900, 900);
         f.doLayout();
+
+        JFrame f2 = new JFrame();
+        f2.setJMenuBar(main.new MyMenuBar());
+        f2.setSize(100,100);
+        f2.show();
+
         main.anneal();
     }