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