1 /*
   2  * Copyright (c) 1997, 2013, 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
  23  * questions.
  24  */
  25 
  26 package 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://docs.oracle.com/javase/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  * @since 1.2
  48  */
  49 public interface WindowConstants
  50 {
  51     /**
  52      * The do-nothing default window close operation.
  53      */
  54     public static final int DO_NOTHING_ON_CLOSE = 0;
  55 
  56     /**
  57      * The hide-window default window close operation
  58      */
  59     public static final int HIDE_ON_CLOSE = 1;
  60 
  61     /**
  62      * The dispose-window default window close operation.
  63      * <p>
  64      * <b>Note</b>: When the last displayable window
  65      * within the Java virtual machine (VM) is disposed of, the VM may
  66      * terminate.  See <a href="../../java/awt/doc-files/AWTThreadIssues.html">
  67      * AWT Threading Issues</a> for more information.
  68      * @see java.awt.Window#dispose()
  69      * @see JInternalFrame#dispose()
  70      */
  71     public static final int DISPOSE_ON_CLOSE = 2;
  72 
  73     /**
  74      * The exit application default window close operation. Attempting
  75      * to set this on Windows that support this, such as
  76      * <code>JFrame</code>, may throw a <code>SecurityException</code> based
  77      * on the <code>SecurityManager</code>.
  78      * It is recommended you only use this in an application.
  79      *
  80      * @since 1.4
  81      * @see JFrame#setDefaultCloseOperation
  82      */
  83     public static final int EXIT_ON_CLOSE = 3;
  84 
  85 }