system.exit or destroy if applet or app
authoramwaterhouse <Andrew Waterhouse>
Tue, 25 Jan 2005 17:11:52 +0000 (17:11 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 25 Jan 2005 17:11:52 +0000 (17:11 +0000)
src/jalview/bin/Jalview.java
src/jalview/gui/Desktop.java

index 69fd7b0..f23bcc9 100755 (executable)
@@ -52,11 +52,11 @@ public class Jalview extends JApplet
 \r
   public void destroy()\r
   {\r
-    System.out.println("Goodbyeee");\r
-\r
-    applet.stop();\r
+    if(applet!=null)\r
+      applet.stop();\r
+    else\r
+      System.exit(0);\r
     frame.setVisible(false);\r
-\r
   }\r
 \r
    public static void main(String[] args) {\r
index d79f472..b0f000e 100755 (executable)
@@ -223,7 +223,10 @@ public class Desktop extends jalview.jbgui.GDesktop
 */\r
  public void quit_actionPerformed(ActionEvent e)\r
  {\r
-   jalview.bin.Jalview.applet.destroy();\r
+   if(jalview.bin.Jalview.applet!=null)\r
+     jalview.bin.Jalview.applet.destroy();\r
+    else\r
+      System.exit(0);\r
  }\r
 \r
 \r