Focus events are generated when a component gets or loses input focus. Focus events come in two flavors, permanent and temporary. Permanent focus events occur with explicit focus changes. For example, when the user tabs through components, this causes permanent focus events. An example of a temporary focus event is when a component loses focus as its containing window is deactivated.
public class java.awt.event.FocusEvent extends java.awt.event.ComponentEvent { // Constants public final static int FOCUS_FIRST; public final static int FOCUS_GAINED; public final static int FOCUS_LAST; public final static int FOCUS_LOST; // Constructors public FocusEvent (Component source, int id); public FocusEvent (Component source, int id, boolean temporary); // Instance Methods public boolean isTemporary(); public String paramString(); }
Specifies the beginning range of focus event ID values.
Event type ID indicating that the component gained the input focus.
Specifies the ending range of focus event ID values.
Event type ID indicating that the component lost the input focus.
The object that generated the event.
The event type ID of the event.
Constructs a non-temporary FocusEvent with the given characteristics.
The object that generated the event.
The event type ID of the event.
A flag indicating whether this is a temporary focus event.
Constructs a FocusEvent with the given characteristics.
true if this is a temporary focus event; false otherwise.
String with current settings of the FocusEvent.
ComponentEvent.paramString()
Helper method for toString() to generate string of current settings.
Component, ComponentEvent, FocusAdapter, FocusListener