All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.event.FocusEvent

java.lang.Object
   |
   +----java.util.EventObject
           |
           +----java.awt.AWTEvent
                   |
                   +----java.awt.event.ComponentEvent
                           |
                           +----java.awt.event.FocusEvent

public class FocusEvent
extends ComponentEvent
The component-level focus event. There are two levels of focus change events: permanent and temporary. Permanent focus change events occur when focus is directly moved from one component to another, such as through calls to requestFocus() or as the user uses the Tab key to traverse components. Temporary focus change events occur when focus is temporarily gained or lost for a component as the indirect result of another operation, such as window deactivation or a scrollbar drag. In this case, the original focus state will automatically be restored once that operation is finished, or, for the case of window deactivation, when the window is reactivated. Both permanent and temporary focus events are delivered using the FOCUS_GAINED and FOCUS_LOST event ids; the levels may be distinguished in the event using the isTemporary() method.


Variable Index

 o FOCUS_FIRST
Marks the first integer id for the range of focus event ids.
 o FOCUS_GAINED
The focus gained event type.
 o FOCUS_LAST
Marks the last integer id for the range of focus event ids.
 o FOCUS_LOST
The focus lost event type.

Constructor Index

 o FocusEvent(Component, int)
Constructs a permanent-level FocusEvent object with the specified source component and type.
 o FocusEvent(Component, int, boolean)
Constructs a FocusEvent object with the specified source component, type, and whether or not the focus event is a temporary level event.

Method Index

 o isTemporary()
Returns whether or not this focus change event is a temporary change.
 o paramString()

Variables

 o FOCUS_FIRST
 public static final int FOCUS_FIRST
Marks the first integer id for the range of focus event ids.

 o FOCUS_LAST
 public static final int FOCUS_LAST
Marks the last integer id for the range of focus event ids.

 o FOCUS_GAINED
 public static final int FOCUS_GAINED
The focus gained event type.

 o FOCUS_LOST
 public static final int FOCUS_LOST
The focus lost event type.

Constructors

 o FocusEvent
 public FocusEvent(Component source,
                   int id,
                   boolean temporary)
Constructs a FocusEvent object with the specified source component, type, and whether or not the focus event is a temporary level event.

Parameters:
source - the object where the event originated
 o FocusEvent
 public FocusEvent(Component source,
                   int id)
Constructs a permanent-level FocusEvent object with the specified source component and type.

Parameters:
source - the object where the event originated

Methods

 o isTemporary
 public boolean isTemporary()
Returns whether or not this focus change event is a temporary change.

 o paramString
 public String paramString()
Overrides:
paramString in class ComponentEvent

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Submit a bug or feature - Version 1.1.8 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1995-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.