jdk/src/share/classes/javax/swing/JFrame.java
changeset 15976 f9578ba3a2c1
parent 12661 6cf8b7116579
child 20455 f6f9a0c2796b
--- a/jdk/src/share/classes/javax/swing/JFrame.java	Wed Feb 13 12:38:28 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JFrame.java	Fri Feb 15 14:24:42 2013 +0400
@@ -387,13 +387,14 @@
             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 (operation == EXIT_ON_CLOSE) {
+            SecurityManager security = System.getSecurityManager();
+            if (security != null) {
+                security.checkExit(0);
+            }
+        }
         if (this.defaultCloseOperation != operation) {
-            if (operation == EXIT_ON_CLOSE) {
-                SecurityManager security = System.getSecurityManager();
-                if (security != null) {
-                    security.checkExit(0);
-                }
-            }
             int oldValue = this.defaultCloseOperation;
             this.defaultCloseOperation = operation;
             firePropertyChange("defaultCloseOperation", oldValue, operation);