FocusEvent

Name

FocusEvent

[Graphic: Figure from the text]

Description

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.

Class Definition

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();
}

Constants

FOCUS_FIRST

public final static int FOCUS_FIRST

Specifies the beginning range of focus event ID values.

FOCUS_GAINED

public final static int FOCUS_GAINED

Event type ID indicating that the component gained the input focus.

FOCUS_LAST

public final static int FOCUS_LAST

Specifies the ending range of focus event ID values.

FOCUS_LOST

public final static int FOCUS_LOST

Event type ID indicating that the component lost the input focus.

Constructors

FocusEvent

public FocusEvent (Component source, int id)

public FocusEvent (Component source, int id, boolean temporary)

Instance Methods

isTemporary

public boolean isTemporary()

paramString

public String paramString()

See Also

Component, ComponentEvent, FocusAdapter, FocusListener