#

| Chapter 21 java.awt.event Reference |

# FocusListener

## Name

FocusListener

##

## Description

Objects that implement the `FocusListener` interface can receive `FocusEvent` objects. Listeners must first register themselves with objects that produce events. When events occur, they are then automatically propagated to all registered listeners.

## Interface Definition

    public abstract interface java.awt.event.FocusListener
       extends java.util.EventListener {
      // Instance Methods
      public abstract void focusGained (FocusEvent e);
      public abstract void focusLost (FocusEvent e);
    }

## Interface Methods

### focusGained

#### public abstract void focusGained (FocusEvent e)

Parameters

  e

    The component event that occurred.

Description

  Notifies the `FocusListener` that a component gained the input focus.

### focusLost

#### public abstract void focusLost (FocusEvent e)

Parameters

  e

    The component event that occurred.

Description

  Notifies the `FocusListener` that a component lost the input focus.

## See Also

`AWTEventMulticaster`, `EventListener`, `FocusAdapter`, `FocusEvent`

FocusEvent |  | InputEvent