APIdia Launch Partner
Top Description Fields
javax.swing

public Interface WindowConstants

Known Direct Implementers
javax.swing.JDialog, javax.swing.JFrame, javax.swing.JInternalFrame

Constants used to control the window-closing operation. The setDefaultCloseOperation and getDefaultCloseOperation methods provided by JFrame, JInternalFrame, and JDialog use these constants. For examples of setting the default window-closing operation, see Responding to Window-Closing Events, a section in The Java Tutorial.
Author
Amy Fowler
Since
1.2
See Also
JFrame#setDefaultCloseOperation(int), JDialog#setDefaultCloseOperation(int), JInternalFrame#setDefaultCloseOperation(int)

Field Summary

Modifier and TypeField and Description
public static final int
DISPOSE_ON_CLOSE

The dispose-window default window close operation.

public static final int
DO_NOTHING_ON_CLOSE

The do-nothing default window close operation.

public static final int
EXIT_ON_CLOSE

The exit application default window close operation.

public static final int
HIDE_ON_CLOSE

The hide-window default window close operation

Field Detail

DISPOSE_ON_CLOSEback to summary
public static final int DISPOSE_ON_CLOSE

The dispose-window default window close operation.

Note

When the last displayable window within the Java virtual machine (VM) is disposed of, the VM may terminate. See AWT Threading Issues for more information.

See Also
java.awt.Window#dispose(), JInternalFrame#dispose()
DO_NOTHING_ON_CLOSEback to summary
public static final int DO_NOTHING_ON_CLOSE

The do-nothing default window close operation.

EXIT_ON_CLOSEback to summary
public static final int EXIT_ON_CLOSE

The exit application default window close operation. It is recommended you only use this in an application.

Since
1.4
See Also
JFrame#setDefaultCloseOperation
HIDE_ON_CLOSEback to summary
public static final int HIDE_ON_CLOSE

The hide-window default window close operation