1 /*
2 * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
95 * appropriate for short term storage or RMI between applications running
96 * the same version of Swing. As of 1.4, support for long term storage
97 * of all JavaBeans™
98 * has been added to the <code>java.beans</code> package.
99 * Please see {@link java.beans.XMLEncoder}.
100 *
101 * @see JRootPane
102 * @see #setDefaultCloseOperation
103 * @see java.awt.event.WindowListener#windowClosing
104 * @see javax.swing.RootPaneContainer
105 *
106 * @beaninfo
107 * attribute: isContainer true
108 * attribute: containerDelegate getContentPane
109 * description: A toplevel window which can be minimized to an icon.
110 *
111 * @author Jeff Dinkins
112 * @author Georges Saab
113 * @author David Kloba
114 */
115 public class JFrame extends Frame implements WindowConstants,
116 Accessible,
117 RootPaneContainer,
118 TransferHandler.HasGetTransferHandler
119 {
120 /**
121 * The exit application default window close operation. If a window
122 * has this set as the close operation and is closed in an applet,
123 * a <code>SecurityException</code> may be thrown.
124 * It is recommended you only use this in an application.
125 * <p>
126 * @since 1.3
127 */
128 public static final int EXIT_ON_CLOSE = 3;
129
130 /**
131 * Key into the AppContext, used to check if should provide decorations
132 * by default.
133 */
134 private static final Object defaultLookAndFeelDecoratedKey =
|
1 /*
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
95 * appropriate for short term storage or RMI between applications running
96 * the same version of Swing. As of 1.4, support for long term storage
97 * of all JavaBeans™
98 * has been added to the <code>java.beans</code> package.
99 * Please see {@link java.beans.XMLEncoder}.
100 *
101 * @see JRootPane
102 * @see #setDefaultCloseOperation
103 * @see java.awt.event.WindowListener#windowClosing
104 * @see javax.swing.RootPaneContainer
105 *
106 * @beaninfo
107 * attribute: isContainer true
108 * attribute: containerDelegate getContentPane
109 * description: A toplevel window which can be minimized to an icon.
110 *
111 * @author Jeff Dinkins
112 * @author Georges Saab
113 * @author David Kloba
114 */
115 @SuppressWarnings("serial") // Same-version serialization only
116 public class JFrame extends Frame implements WindowConstants,
117 Accessible,
118 RootPaneContainer,
119 TransferHandler.HasGetTransferHandler
120 {
121 /**
122 * The exit application default window close operation. If a window
123 * has this set as the close operation and is closed in an applet,
124 * a <code>SecurityException</code> may be thrown.
125 * It is recommended you only use this in an application.
126 * <p>
127 * @since 1.3
128 */
129 public static final int EXIT_ON_CLOSE = 3;
130
131 /**
132 * Key into the AppContext, used to check if should provide decorations
133 * by default.
134 */
135 private static final Object defaultLookAndFeelDecoratedKey =
|