01 /*
02 * Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved.
03 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04 *
05 * This code is free software; you can redistribute it and/or modify it
06 * under the terms of the GNU General Public License version 2 only, as
07 * published by the Free Software Foundation. Sun designates this
08 * particular file as subject to the "Classpath" exception as provided
09 * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 package javax.swing;
27
28 /**
29 * Constants used to control the window-closing operation.
30 * The <code>setDefaultCloseOperation</code> and
31 * <code>getDefaultCloseOperation</code> methods
32 * provided by <code>JFrame</code>,
33 * <code>JInternalFrame</code>, and
34 * <code>JDialog</code>
35 * use these constants.
36 * For examples of setting the default window-closing operation, see
37 * <a
38 href="http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html#windowevents">Responding to Window-Closing Events</a>,
39 * a section in <em>The Java Tutorial</em>.
40 * @see JFrame#setDefaultCloseOperation(int)
41 * @see JDialog#setDefaultCloseOperation(int)
42 * @see JInternalFrame#setDefaultCloseOperation(int)
43 *
44 *
45 * @version 1.28 05/05/07
46 * @author Amy Fowler
47 */
48 public interface WindowConstants {
49 /**
50 * The do-nothing default window close operation.
51 */
52 public static final int DO_NOTHING_ON_CLOSE = 0;
53
54 /**
55 * The hide-window default window close operation
56 */
57 public static final int HIDE_ON_CLOSE = 1;
58
59 /**
60 * The dispose-window default window close operation.
61 * <p>
62 * <b>Note</b>: When the last displayable window
63 * within the Java virtual machine (VM) is disposed of, the VM may
64 * terminate. See <a href="../../java/awt/doc-files/AWTThreadIssues.html">
65 * AWT Threading Issues</a> for more information.
66 * @see java.awt.Window#dispose()
67 * @see JInternalFrame#dispose()
68 */
69 public static final int DISPOSE_ON_CLOSE = 2;
70
71 /**
72 * The exit application default window close operation. Attempting
73 * to set this on Windows that support this, such as
74 * <code>JFrame</code>, may throw a <code>SecurityException</code> based
75 * on the <code>SecurityManager</code>.
76 * It is recommended you only use this in an application.
77 *
78 * @since 1.4
79 * @see JFrame#setDefaultCloseOperation
80 */
81 public static final int EXIT_ON_CLOSE = 3;
82
83 }
|