1 /* 2 * @(#)WindowConstants.java 1.21 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package javax.swing; 9 10 11 /** 12 * Constants used to control the window-closing operation. 13 * The <code>setDefaultCloseOperation</code> and 14 * <code>getDefaultCloseOperation</code> methods 15 * provided by <code>JFrame</code>, 16 * <code>JInternalFrame</code>, and 17 * <code>JDialog</code> 18 * use these constants. 19 * For examples of setting the default window-closing operation, see 20 * <a 21 href="http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html#windowevents">Responding to Window-Closing Events</a>, 22 * a section in <em>The Java Tutorial</em>. 23 * @see JFrame#setDefaultCloseOperation(int) 24 * @see JDialog#setDefaultCloseOperation(int) 25 * @see JInternalFrame#setDefaultCloseOperation(int) 26 * 27 * 28 * @version 1.21 12/19/03 29 * @author Amy Fowler 30 */ 31 public interface WindowConstants 32 { 33 /** 34 * The do-nothing default window close operation. 35 */ 36 public static final int DO_NOTHING_ON_CLOSE = 0; 37 38 /** 39 * The hide-window default window close operation 40 */ 41 public static final int HIDE_ON_CLOSE = 1; 42 43 /** 44 * The dispose-window default window close operation. 45 * <p> 46 * <b>Note</b>: When the last displayable window 47 * within the Java virtual machine (VM) is disposed of, the VM may 48 * terminate. See <a HREF="../../java/awt/doc-files/AWTThreadIssues.html"> 49 * AWT Threading Issues</a> for more information. 50 * @see java.awt.Window#dispose() 51 * @see JInternalFrame#dispose() 52 */ 53 public static final int DISPOSE_ON_CLOSE = 2; 54 55 /** 56 * The exit application default window close operation. Attempting 57 * to set this on Windows that support this, such as 58 * <code>JFrame</code>, may throw a <code>SecurityException</code> based 59 * on the <code>SecurityManager</code>. 60 * It is recommended you only use this in an application. 61 * 62 * @since 1.4 63 * @see JFrame#setDefaultCloseOperation 64 */ 65 public static final int EXIT_ON_CLOSE = 3; 66 67 } 68