|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
java.awt.AWTEvent
java.awt.event.ComponentEvent
java.awt.event.WindowEvent
public class WindowEvent
This event is generated when there is a change in a window. This includes creation, closing, iconification, activation, and focus changes. There are three listeners, for three types of events: WindowListeners deal with the lifecycle of a window, WindowStateListeners deal with window state like maximization, and WindowFocusListeners deal with focus switching to or from a window.
WindowAdapter
,
WindowListener
,
WindowFocusListener
,
WindowStateListener
,
Serialized FormField Summary | |
---|---|
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. |
Fields inherited from class java.awt.event.ComponentEvent |
---|
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN |
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.awt.event.ComponentEvent |
---|
getComponent |
Methods inherited from class java.awt.AWTEvent |
---|
consume, getID, isConsumed, setSource, toString |
Methods inherited from class java.util.EventObject |
---|
getSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
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 window
IllegalArgumentException
- 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 null
IllegalArgumentException
- 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 window
IllegalArgumentException
- 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 id
IllegalArgumentException
- if source is nullMethod Detail |
---|
public 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |