diff --git a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/J2DBench.java b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/J2DBench.java
index 2294e7f01be..053908ca8d8 100644
--- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/J2DBench.java
+++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/J2DBench.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -61,6 +61,7 @@ import javax.swing.BoxLayout;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -698,7 +699,7 @@ public class J2DBench {
}
};
guiFrame = f;
- f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.getContentPane().setLayout(new BorderLayout());
f.getContentPane().add(Group.root.getJComponent(), BorderLayout.CENTER);
JPanel p = new JPanel();
diff --git a/jdk/src/demo/share/jfc/SampleTree/SampleTree.java b/jdk/src/demo/share/jfc/SampleTree/SampleTree.java
index efde28fd6f0..c7093a157ae 100644
--- a/jdk/src/demo/share/jfc/SampleTree/SampleTree.java
+++ b/jdk/src/demo/share/jfc/SampleTree/SampleTree.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -135,7 +135,7 @@ public final class SampleTree {
panel.add("Center", sp);
panel.add("South", constructOptionsPanel());
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
diff --git a/jdk/src/demo/share/management/JTop/JTop.java b/jdk/src/demo/share/management/JTop/JTop.java
index ab0cd94e33d..c1d48cc3716 100644
--- a/jdk/src/demo/share/management/JTop/JTop.java
+++ b/jdk/src/demo/share/management/JTop/JTop.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -410,7 +410,7 @@ public class JTop extends JPanel {
private static void createAndShowGUI(JPanel jtop) {
// Create and set up the window.
JFrame frame = new JFrame("JTop");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
// Create and set up the content pane.
JComponent contentPane = (JComponent) frame.getContentPane();
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JFrame.java b/jdk/src/java.desktop/share/classes/javax/swing/JFrame.java
index 68d81f602a4..be6b5ba96ba 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JFrame.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JFrame.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -127,16 +127,6 @@ public class JFrame extends Frame implements WindowConstants,
RootPaneContainer,
TransferHandler.HasGetTransferHandler
{
- /**
- * The exit application default window close operation. If a window
- * has this set as the close operation and is closed in an applet,
- * a SecurityException may be thrown.
- * It is recommended you only use this in an application.
- *
- * @since 1.3
- */
- public static final int EXIT_ON_CLOSE = 3;
-
/**
* Key into the AppContext, used to check if should provide decorations
* by default.
@@ -352,7 +342,7 @@ public class JFrame extends Frame implements WindowConstants,
* objects.
*
*
EXIT_ON_CLOSE
- * (defined in JFrame):
+ * (defined in WindowConstants):
* Exit the application using the System
* exit method. Use this only in applications.
*
@@ -393,7 +383,9 @@ public class JFrame extends Frame implements WindowConstants,
operation != HIDE_ON_CLOSE &&
operation != DISPOSE_ON_CLOSE &&
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");
+ 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) {
@@ -861,7 +853,7 @@ public class JFrame extends Frame implements WindowConstants,
defaultCloseOperationString = "DISPOSE_ON_CLOSE";
} else if (defaultCloseOperation == DO_NOTHING_ON_CLOSE) {
defaultCloseOperationString = "DO_NOTHING_ON_CLOSE";
- } else if (defaultCloseOperation == 3) {
+ } else if (defaultCloseOperation == EXIT_ON_CLOSE) {
defaultCloseOperationString = "EXIT_ON_CLOSE";
} else defaultCloseOperationString = "";
String rootPaneString = (rootPane != null ?
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java b/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java
index 9c22489f5b6..833b09e6e73 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@ import java.security.PrivilegedAction;
*
* private static void createAndShowGUI() {
* final JFrame frame = new JFrame();
- * frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ * frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
*
* // work with the layer as with any other Swing component
* frame.add(createLayer());