java.awt.event
public class WindowEvent extends ComponentEvent
WindowAdapter
,
WindowListener
,
WindowFocusListener
,
WindowStateListener
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
WINDOW_ACTIVATED
This is the id for a window that is activated.
|
static int |
WINDOW_CLOSED
This is the id for a window that finished closing.
|
static int |
WINDOW_CLOSING
This is the id for a window that is about to close.
|
static int |
WINDOW_DEACTIVATED
This is the id for a window that is de-activated.
|
static int |
WINDOW_DEICONIFIED
This is the id for a window that is de-iconified.
|
static int |
WINDOW_FIRST
This is the first id in the range of event ids used by this class.
|
static int |
WINDOW_GAINED_FOCUS
This is the id for a window becoming the focused window.
|
static int |
WINDOW_ICONIFIED
This is the id for a window that is iconified.
|
static int |
WINDOW_LAST
This is the last id in the range of event ids used by this class.
|
static int |
WINDOW_LOST_FOCUS
This is the id for a window losing all focus.
|
static int |
WINDOW_OPENED
This is the id for a window that is opened.
|
static int |
WINDOW_STATE_CHANGED
This is the id for a window state change, such as maximization.
|
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK
source
Constructor and Description |
---|
WindowEvent(Window source,
int id)
Initializes a new instance of
WindowEvent with the specified
parameters. |
WindowEvent(Window source,
int id,
int oldState,
int newState)
Initializes a new instance of
WindowEvent with the specified
parameters. |
WindowEvent(Window source,
int id,
Window opposite)
Initializes a new instance of
WindowEvent with the specified
parameters. |
WindowEvent(Window source,
int id,
Window opposite,
int oldState,
int newState)
Initializes a new instance of
WindowEvent with the specified
parameters. |
Modifier and Type | Method and Description |
---|---|
int |
getNewState()
Returns the state of this window after the event.
|
int |
getOldState()
Returns the state of this window before the event.
|
Window |
getOppositeWindow()
Returns the opposite window if this window was involved in an activation
or focus change.
|
Window |
getWindow()
Returns the event source as a
Window . |
String |
paramString()
Returns a string that identifies this event.
|
getComponent
getSource
public static final int WINDOW_FIRST
public static final int WINDOW_OPENED
public static final int WINDOW_CLOSING
public static final int WINDOW_CLOSED
public static final int WINDOW_ICONIFIED
public static final int WINDOW_DEICONIFIED
public static final int WINDOW_ACTIVATED
public static final int WINDOW_DEACTIVATED
public static final int WINDOW_GAINED_FOCUS
public static final int WINDOW_LOST_FOCUS
public static final int WINDOW_STATE_CHANGED
public static final int WINDOW_LAST
public WindowEvent(Window source, int id, Window opposite, int oldState, int newState)
WindowEvent
with the specified
parameters. Note that an invalid id leads to unspecified results.source
- the window that generated this eventid
- the event idopposite
- the window that received the opposite event, or nulloldState
- the previous state of this windownewState
- the new state of this windowIllegalArgumentException
- if source is nullpublic WindowEvent(Window source, int id, Window opposite)
WindowEvent
with the specified
parameters. Note that an invalid id leads to unspecified results.source
- the window that generated this eventid
- the event idopposite
- the window that received the opposite event, or nullIllegalArgumentException
- if source is nullpublic WindowEvent(Window source, int id, int oldState, int newState)
WindowEvent
with the specified
parameters. Note that an invalid id leads to unspecified results.source
- the window that generated this eventid
- the event idoldState
- the previous state of this windownewState
- the new state of this windowIllegalArgumentException
- if source is nullpublic WindowEvent(Window source, int id)
WindowEvent
with the specified
parameters. Note that an invalid id leads to unspecified results.source
- the window that generated this eventid
- the event idIllegalArgumentException
- if source is nullpublic Window getWindow()
Window
. If the source has
subsequently been modified to a non-Window, this returns null.Window
public Window getOppositeWindow()
public int getOldState()
Frame.getExtendedState()
public int getNewState()
Frame.getExtendedState()
public String paramString()
paramString
in class ComponentEvent