X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FMainFrameApplication.java;h=9349f8cc403e1f48ba634f9c28d77361bbcf73d2;hb=a2e1b38bab7e593d79946c24e653776e6d796e00;hp=cb5b8debc442377e177f7e6e19504d35e901a6b4;hpb=5bae4861f59350b3158d6ebd5034ea7698d81b98;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java index cb5b8de..9349f8c 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java @@ -57,6 +57,8 @@ import javax.swing.UnsupportedLookAndFeelException; import javax.swing.WindowConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import javax.swing.event.InternalFrameAdapter; +import javax.swing.event.InternalFrameEvent; import org.forester.analysis.TaxonomyDataManager; import org.forester.archaeopteryx.Options.CLADOGRAM_TYPE; @@ -161,10 +163,10 @@ public final class MainFrameApplication extends MainFrame { setSize( MainFrameApplication.FRAME_X_SIZE, MainFrameApplication.FRAME_Y_SIZE ); // The window listener setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE ); - addWindowListener( new WindowAdapter() { + addInternalFrameListener( new InternalFrameAdapter() { @Override - public void windowClosing( final WindowEvent e ) { + public void internalFrameClosing (final InternalFrameEvent e ) { exit(); } } ); @@ -302,14 +304,14 @@ public final class MainFrameApplication extends MainFrame { // } ); // The window listener setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE ); - addWindowListener( new WindowAdapter() { + addInternalFrameListener( new InternalFrameAdapter() { @Override - public void windowClosing( final WindowEvent e ) { + public void internalFrameClosing( final InternalFrameEvent e ) { if ( isUnsavedDataPresent() ) { - final int r = JOptionPane.showConfirmDialog( null, - "Exit despite potentially unsaved changes?", - "Exit?", + final int r = JOptionPane.showConfirmDialog( _mainpanel, + "Close Archaeopteryx despite potentially unsaved changes?", + "Close viewer?", JOptionPane.YES_NO_OPTION ); if ( r != JOptionPane.YES_OPTION ) { return;