java.awt.event
public class FocusEvent extends ComponentEvent
Since: 1.1
See Also: FocusAdapter FocusListener
UNKNOWN: updated to 1.4
Field Summary | |
---|---|
static int | FOCUS_FIRST This is the first id in the range of ids used by this class. |
static int | FOCUS_GAINED This is the event id for a focus gained event. |
static int | FOCUS_LAST This is the last id in the range of ids used by this class. |
static int | FOCUS_LOST This is the event id for a focus lost event. |
Constructor Summary | |
---|---|
FocusEvent(Component source, int id, boolean temporary, Component opposite)
Initializes a new instance of FocusEvent with the
specified source, id, temporary status, and opposite counterpart. | |
FocusEvent(Component source, int id, boolean temporary)
Initializes a new instance of FocusEvent with the
specified source, id, and temporary status. | |
FocusEvent(Component source, int id)
Initializes a new instance of FocusEvent with the
specified source and id. |
Method Summary | |
---|---|
Component | getOppositeComponent()
Returns the component which received the opposite focus event. |
boolean | isTemporary()
This method tests whether or not the focus change is temporary or
permanent.
|
String | paramString()
Returns a string identifying this event. |
FocusEvent
with the
specified source, id, temporary status, and opposite counterpart. Note
that an invalid id leads to unspecified results.
Parameters: source the component that is gaining or losing focus id the event id temporary true if the focus change is temporary opposite the component receiving the opposite focus event, or null
Throws: IllegalArgumentException if source is null
FocusEvent
with the
specified source, id, and temporary status. Note that an invalid id
leads to unspecified results.
Parameters: source the component that is gaining or losing focus id the event id temporary true if the focus change is temporary
Throws: IllegalArgumentException if source is null
FocusEvent
with the
specified source and id. Note that an invalid id leads to unspecified
results.
Parameters: source the component that is gaining or losing focus id the event id
Throws: IllegalArgumentException if source is null
Returns: the component with the focus opposite, or null
Since: 1.4
Returns: true if the focus change is temporary
(getID() == FOCUS_GAINED ? "FOCUS_GAINED" : "FOCUS_LOST")
+ (isTemporary() ? ",temporary," : ",permanent,") + "opposite="
+ getOppositeComponent()
.
Returns: a string identifying this event