From: gmungoc Date: Thu, 27 Oct 2016 08:03:05 +0000 (+0100) Subject: JAL-2287 treat Escape like Cancel in dialog box X-Git-Tag: Release_2_10_1^2~22^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=89da71c0b164a26d5613167ec467db95701b4638;p=jalview.git JAL-2287 treat Escape like Cancel in dialog box --- diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java index bccbda8..ce719d0 100644 --- a/src/jalview/gui/ChimeraViewFrame.java +++ b/src/jalview/gui/ChimeraViewFrame.java @@ -59,9 +59,7 @@ import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Random; -import java.util.Set; import java.util.Vector; import javax.swing.JCheckBoxMenuItem; @@ -535,7 +533,11 @@ public class ChimeraViewFrame extends StructureViewerBase int confirm = JOptionPane.showConfirmDialog(this, prompt, MessageManager.getString("label.close_viewer"), JOptionPane.YES_NO_CANCEL_OPTION); - if (confirm == JOptionPane.CANCEL_OPTION) + /* + * abort closure if user hits escape or Cancel + */ + if (confirm == JOptionPane.CANCEL_OPTION + || confirm == JOptionPane.CLOSED_OPTION) { return; }