blob: 8935eba5c158ae116288c457b423fcd63f252072 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 1997-2003 Sun Microsystems, Inc. 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. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * 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
26package javax.swing;
27
28
29/**
30 * Constants used to control the window-closing operation.
31 * The <code>setDefaultCloseOperation</code> and
32 * <code>getDefaultCloseOperation</code> methods
33 * provided by <code>JFrame</code>,
34 * <code>JInternalFrame</code>, and
35 * <code>JDialog</code>
36 * use these constants.
37 * For examples of setting the default window-closing operation, see
38 * <a
39 href="http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html#windowevents">Responding to Window-Closing Events</a>,
40 * a section in <em>The Java Tutorial</em>.
41 * @see JFrame#setDefaultCloseOperation(int)
42 * @see JDialog#setDefaultCloseOperation(int)
43 * @see JInternalFrame#setDefaultCloseOperation(int)
44 *
45 *
46 * @author Amy Fowler
47 */
48public interface WindowConstants
49{
50 /**
51 * The do-nothing default window close operation.
52 */
53 public static final int DO_NOTHING_ON_CLOSE = 0;
54
55 /**
56 * The hide-window default window close operation
57 */
58 public static final int HIDE_ON_CLOSE = 1;
59
60 /**
61 * The dispose-window default window close operation.
62 * <p>
63 * <b>Note</b>: When the last displayable window
64 * within the Java virtual machine (VM) is disposed of, the VM may
65 * terminate. See <a href="../../java/awt/doc-files/AWTThreadIssues.html">
66 * AWT Threading Issues</a> for more information.
67 * @see java.awt.Window#dispose()
68 * @see JInternalFrame#dispose()
69 */
70 public static final int DISPOSE_ON_CLOSE = 2;
71
72 /**
73 * The exit application default window close operation. Attempting
74 * to set this on Windows that support this, such as
75 * <code>JFrame</code>, may throw a <code>SecurityException</code> based
76 * on the <code>SecurityManager</code>.
77 * It is recommended you only use this in an application.
78 *
79 * @since 1.4
80 * @see JFrame#setDefaultCloseOperation
81 */
82 public static final int EXIT_ON_CLOSE = 3;
83
84}