diff --git a/src/share/classes/javax/swing/JFrame.java b/src/share/classes/javax/swing/JFrame.java index cccd6f98aa5b95b7ddaecd09ee60dd682ca35d0b..aee994eecf9eaddeb5626b07b9874ed6d1228a3c 100644 --- a/src/share/classes/javax/swing/JFrame.java +++ b/src/share/classes/javax/swing/JFrame.java @@ -387,13 +387,14 @@ public class JFrame extends Frame implements WindowConstants, operation != EXIT_ON_CLOSE) { throw new IllegalArgumentException("defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or EXIT_ON_CLOSE"); } - if (this.defaultCloseOperation != operation) { - if (operation == EXIT_ON_CLOSE) { - SecurityManager security = System.getSecurityManager(); - if (security != null) { - security.checkExit(0); - } + + if (operation == EXIT_ON_CLOSE) { + SecurityManager security = System.getSecurityManager(); + if (security != null) { + security.checkExit(0); } + } + if (this.defaultCloseOperation != operation) { int oldValue = this.defaultCloseOperation; this.defaultCloseOperation = operation; firePropertyChange("defaultCloseOperation", oldValue, operation);