JavaTM 2 Platform
Standard Ed. 6

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 int DISPOSE_ON_CLOSE
          移除窗口的默认窗口关闭操作。
static int DO_NOTHING_ON_CLOSE
          无操作默认窗口关闭操作。
static int EXIT_ON_CLOSE
          退出应用程序默认窗口关闭操作。
static int HIDE_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), 常量字段值

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策