public interface WindowConstants
JFrame,
JInternalFrame提供
setDefaultCloseOperation和
getDefaultCloseOperation方法,和
JDialog使用这些常量。用于设置默认的窗口关闭操作,例子见
Responding to Window-Closing Events,java教程中的一部分。
| Modifier and Type | Field and Description |
|---|---|
static int |
DISPOSE_ON_CLOSE
处理窗口默认窗口关闭操作。
|
static int |
DO_NOTHING_ON_CLOSE
无默认窗口关闭操作。
|
static int |
EXIT_ON_CLOSE
退出应用程序默认窗口关闭操作。
|
static int |
HIDE_ON_CLOSE
隐藏窗口默认窗口关闭操作
|
static final int DO_NOTHING_ON_CLOSE
static final int HIDE_ON_CLOSE
static final int DISPOSE_ON_CLOSE
注:当最后一个显示窗口的java虚拟机(VM)内设置,虚拟机可能会终止。更多信息见 AWT Threading Issues。
static final int EXIT_ON_CLOSE
JFrame,可以把一个
SecurityException基于
SecurityManager。建议您仅在应用程序中使用此。
JFrame.setDefaultCloseOperation(int),
Constant Field Values
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.