Java Reference
In-Depth Information
METHOD
DESCRIPTION
Called when a window is restored from an icon.
windowDeiconified(WindowEvent
e)
The WindowFocusListener Interface
The WindowFocusListener interface declares methods (shown in Table 18-6 ) to respond to a window gain-
ing or losing the focus. When a window has the focus, one of its child components can receive input from
the keyboard. When it loses the focus, keyboard input via a child component of the window is not possible.
TABLE 18-6 : WindowFocusListener Methods
METHOD
DESCRIPTION
Called when a window gains the focus such that the window or one of its compon-
ents can receive keyboard events.
windowGainedFocus(WindowEvent
e)
Called when a window loses the focus. After this event, neither the window nor
any of its components receive keyboard events.
windowLostFocus(WindowEvent
e)
The WindowStateListener Interface
The WindowStateListener interface declares a method to respond to any change in the state of a window
(see Table 18-7 ).
TABLE 18-7 : WindowStateListener Method
METHOD
DESCRIPTION
Called when the window state changes — when it is maximized or iconified, for
example.
windowStateChanged(WindowEvent
e)
The MouseListener Interface
The MouseListener interface declares methods (shown in Table 18-7 ) to respond to events arising when
the mouse cursor is moved into or out of the area occupied by a component, or one of the mouse buttons is
pressed, released, or clicked.
TABLE 18-8: MouseListener Methods
METHOD
DESCRIPTION
Called when a mouse button is clicked when the cursor is on a component — that is,
when the button is pressed and released.
mouseClicked(MouseEvent
e)
Called when a mouse button is pressed when the cursor is on a component.
mousePressed(MouseEvent
e)
Called when a mouse button is released when the cursor is on a component.
mouseReleased(MouseEvent
e)
Called when the mouse cursor enters the area occupied by a component.
mouseEntered(MouseEvent
e)
Called when the mouse cursor exits the area occupied by a component.
mouseExited(MouseEvent
e)
The MouseMotionListener Interface
 
 
 
 
Search WWH ::




Custom Search