AWT WindowEvent类
这个类的对象表示一个窗口的状态的变化。这种低层次的事件所产生的一个窗口对象,当它被打开,关闭,激活,停用,图标化或当焦点转移到窗外。
类的声明
以下是声明的 java.awt.event.WindowEvent类:
public class WindowEvent extends ComponentEvent
字段域
字段类java.awt.event.WindowEvent:
-
static int WINDOW_ACTIVATED --窗口激活的事件类型.
-
static int WINDOW_CLOSED -- 窗口关闭事件。
-
static int WINDOW_CLOSING -- “窗口正在关闭”的事件。
-
static int WINDOW_DEACTIVATED -- 窗口停用的事件类型。
-
static int WINDOW_DEICONIFIED -- 窗口图标化事件类型。
-
static int WINDOW_FIRST -- 用于窗口事件的ID范围内的第一个数字。
-
static int WINDOW_GAINED_FOCUS -- 窗口获得焦点的事件类型。
-
static int WINDOW_ICONIFIED -- 窗口图标化事件。
-
static int WINDOW_LAST -- 最后一个数字范围内用于窗口事件的ID。
-
static int WINDOW_LOST_FOCUS -- 窗口失去焦点的事件类型。
-
static int WINDOW_OPENED -- 打开的窗口事件。
-
static int WINDOW_STATE_CHANGED -- 窗口状态改变的事件类型。
类的构造函数
S.N. | 构造函数与说明 |
---|---|
1 |
WindowEvent(Window source, int id) Constructs a WindowEvent object. |
2 |
WindowEvent(Window source, int id, int oldState, int newState) Constructs a WindowEvent object with the specified previous and new window states. |
3 |
WindowEvent(Window source, int id, Window opposite) Constructs a WindowEvent object with the specified opposite Window. |
4 |
WindowEvent(Window source, int id, Window opposite, int oldState, int newState) Constructs a WindowEvent object. |
类方法
S.N. | 方法和说明 |
---|---|
1 |
int getNewState() For WINDOW_STATE_CHANGED events returns the new state of the window. |
2 |
int getOldState() For WINDOW_STATE_CHANGED events returns the previous state of the window. |
3 |
Window getOppositeWindow() Returns the other Window involved in this focus or activation change. |
4 |
Window getWindow() Returns the originator of the event. |
5 |
String paramString() Returns a parameter string identifying this event. |
继承的方法
这个类继承的方法从以下类:
-
java.awt.event.ComponentEvent
-
java.awt.AWTEvent
-
java.util.EventObject
-
java.lang.Object