+ /*
+ if (!Platform.isAMac())
+ {
+ // this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+ }
+ else
+ */
+ // {
+ // this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+ java.awt.Desktop hdesktop = java.awt.Desktop.getDesktop();
+
+ hdesktop.setAboutHandler(new AboutHandler()
+ {
+ @Override
+ public void handleAbout(AboutEvent e)
+ {
+ aboutMenuItem_actionPerformed(null);
+ }
+ });
+ hdesktop.setPreferencesHandler(new PreferencesHandler()
+ {
+ @Override
+ public void handlePreferences(PreferencesEvent e)
+ {
+ preferences_actionPerformed(null);
+ }
+ });
+ hdesktop.setQuitHandler(new QuitHandler()
+ {
+ @Override
+ public void handleQuitRequestWith(QuitEvent e, QuitResponse r)
+ {
+ int n = JOptionPane.showConfirmDialog(null,
+ MessageManager.getString("label.quit_jalview"),
+ MessageManager.getString("action.quit"),
+ JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE,
+ null);
+ if (n == JOptionPane.OK_OPTION)
+ {
+ System.out.println("Shortcut Quit confirmed by user");
+ quit();
+ }
+ else
+ {
+ System.out.println("Shortcut Quit cancelled by user");
+ }
+ }
+ });
+
+ // }
+
+ addWindowListener(new WindowAdapter()
+ {
+
+ @Override
+ public void windowClosing(WindowEvent ev)
+ {
+ quit();
+ }
+ });
+