所有类


javax.swing
接口 WindowConstants

所有已知实现类:
JDialog, JFrame, JInternalFrame

public interface WindowConstants

用于控制窗口关闭操作的常量。由 JFrameJInternalFrameJDialog 提供的 setDefaultCloseOperationgetDefaultCloseOperation 方法使用这些常量。有关设置默认窗口操作的示例,请参阅《The Java Tutorial》中的 Responding to Window-Closing Events 一节。

另请参见:
JFrame.setDefaultCloseOperation(int), JDialog.setDefaultCloseOperation(int), JInternalFrame.setDefaultCloseOperation(int)

字段摘要
static intDISPOSE_ON_CLOSE
          移除窗口的默认窗口关闭操作。
static intDO_NOTHING_ON_CLOSE
          无操作默认窗口关闭操作。
static intEXIT_ON_CLOSE
          退出应用程序默认窗口关闭操作。
static intHIDE_ON_CLOSE
          隐藏窗口的默认窗口关闭操作
 

字段详细信息

DO_NOTHING_ON_CLOSE

static final int DO_NOTHING_ON_CLOSE
无操作默认窗口关闭操作。

另请参见:
常量字段值

HIDE_ON_CLOSE

static final int HIDE_ON_CLOSE
隐藏窗口的默认窗口关闭操作

另请参见:
常量字段值

DISPOSE_ON_CLOSE

static final int DISPOSE_ON_CLOSE
移除窗口的默认窗口关闭操作。

注:当 Java 虚拟机 (VM) 中最后的可显示窗口被移除后,虚拟机可能会终止。有关更多信息,请参阅 AWT Threading Issues

另请参见:
Window.dispose(), JInternalFrame.dispose(), 常量字段值

EXIT_ON_CLOSE

static final int EXIT_ON_CLOSE
退出应用程序默认窗口关闭操作。尝试在支持此操作的 Windows 上执行此项设置(如 JFrame)可能会根据 SecurityManager 抛出一个 SecurityException。建议您只在应用程序中使用此项操作。

从以下版本开始:
1.4
另请参见:
JFrame.setDefaultCloseOperation(int), 常量字段值

所有类