]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
exit for closing window is only called for the AWTStarter, command line
authorKeiron Liddle <keiron@apache.org>
Wed, 20 Feb 2002 10:29:40 +0000 (10:29 +0000)
committerKeiron Liddle <keiron@apache.org>
Wed, 20 Feb 2002 10:29:40 +0000 (10:29 +0000)
and not on the window

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194657 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/apps/AWTStarter.java
src/org/apache/fop/viewer/PreviewDialog.java

index 85fcaa9be4455fbd132a909664aeda317c4a9a74..20b0d8456a20bd9be6d44b7cdd4735f7032485b2 100644 (file)
@@ -19,6 +19,8 @@ import org.apache.fop.render.awt.*;
 
 import javax.swing.UIManager;
 import java.awt.*;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
 
 // SAX
 import org.xml.sax.XMLReader;
@@ -130,6 +132,11 @@ public class AWTStarter extends CommandLineStarter {
             Translator res) {
         PreviewDialog frame = new PreviewDialog(renderer, res);
         frame.validate();
+        frame.addWindowListener(new WindowAdapter() {
+            public void windowClosed(WindowEvent we) {
+                System.exit(0);
+            }
+        });
 
         // center window
         Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
index 219c25078560e3ef2cddc1ca723888868440356d..401124b6e833a08d7286c7f9b4457f49dc4ac415 100644 (file)
@@ -624,9 +624,5 @@ public class PreviewDialog extends JFrame implements ProgressListener {
         }*/
     }
 
-    public void dispose() {
-        System.exit(0);
-    }
-
 }    // class PreviewDialog