From 5af15a140e00ca7dc05f5e1e77fabdc0f1873b29 Mon Sep 17 00:00:00 2001 From: Keiron Liddle Date: Wed, 20 Feb 2002 10:29:40 +0000 Subject: [PATCH] exit for closing window is only called for the AWTStarter, command line 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 | 7 +++++++ src/org/apache/fop/viewer/PreviewDialog.java | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/org/apache/fop/apps/AWTStarter.java b/src/org/apache/fop/apps/AWTStarter.java index 85fcaa9be..20b0d8456 100644 --- a/src/org/apache/fop/apps/AWTStarter.java +++ b/src/org/apache/fop/apps/AWTStarter.java @@ -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(); diff --git a/src/org/apache/fop/viewer/PreviewDialog.java b/src/org/apache/fop/viewer/PreviewDialog.java index 219c25078..401124b6e 100644 --- a/src/org/apache/fop/viewer/PreviewDialog.java +++ b/src/org/apache/fop/viewer/PreviewDialog.java @@ -624,9 +624,5 @@ public class PreviewDialog extends JFrame implements ProgressListener { }*/ } - public void dispose() { - System.exit(0); - } - } // class PreviewDialog -- 2.39.5