Microsoft SDK for Java

FocusEvent Class Constructors

The FocusEvent Class contains the following constructors:

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

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

Creates a FocusEvent object by using the component that received the focus, the component that lost focus, the identifier of the focus event, and whether the focus event is temporary or permanent.

Syntax

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

Parameters

source The component that generates the event.
other The target component.
id The identifier of the focus event. This may be either FOCUS_LOST or FOCUS_GAINED.

If the identifier is FOCUS_GAINED, the other component is the component that loses focus. If the identifier is FOCUS_LOST, the other component is the component that gains focus. However, if the application is currently gaining or losing focus, the identifier may be null.

temporary Set to true if the focus change is a temporary one. Set to false if the focus change is a permanent one.

FocusEvent(Component source, int id, Component other)

Creates a FocusEvent object by using the component that received the focus, the component that lost focus, and the identifier of the focus event. A FocusEvent created with this constructor is permanent (by default).

Syntax

public FocusEvent(Component source, int id, Component other);

Parameters

source The component that generates the event.
other The target component.
id The identifier of the focus event. This may be either FOCUS_LOST or FOCUS_GAINED.

If the identifier is FOCUS_GAINED, the other component is the component that loses focus. If the identifier is FOCUS_LOST, the other component is the component that gains focus. However, if the application is currently gaining or losing focus, the identifier may be null.


© 1999 Microsoft Corporation. All rights reserved. Terms of use.