APIdia Launch Partner
Top Description Methods
java.awt.event

public Interface FocusListener

extends EventListener
Known Direct Implementers
javax.swing.JComponent.AccessibleJComponent.AccessibleFocusHandler, javax.swing.JMenuItem.MenuItemFocusListener, javax.swing.colorchooser.ValueFormatter, javax.swing.plaf.basic.BasicButtonListener, javax.swing.plaf.basic.BasicComboBoxEditor, javax.swing.plaf.basic.BasicComboBoxUI.FocusHandler, javax.swing.plaf.basic.BasicComboBoxUI.Handler, javax.swing.plaf.basic.BasicListUI.FocusHandler, javax.swing.plaf.basic.BasicListUI.Handler, javax.swing.plaf.basic.BasicScrollBarUI.Handler, javax.swing.plaf.basic.BasicSliderUI.Handler, javax.swing.plaf.basic.BasicSliderUI.FocusHandler, javax.swing.plaf.basic.BasicSpinnerUI.ArrowButtonHandler, javax.swing.plaf.basic.BasicSplitPaneUI.Handler, javax.swing.plaf.basic.BasicTabbedPaneUI.Handler, javax.swing.plaf.basic.BasicTableUI.FocusHandler, javax.swing.plaf.basic.BasicTableUI.Handler, javax.swing.plaf.basic.BasicToolBarUI.Handler, javax.swing.plaf.basic.BasicToolBarUI.ToolBarFocusListener, javax.swing.plaf.basic.BasicTreeUI.FocusHandler, javax.swing.plaf.basic.BasicTreeUI.Handler, javax.swing.plaf.synth.SynthComboBoxUI.EditorFocusHandler, javax.swing.plaf.synth.SynthScrollPaneUI.ViewportViewFocusHandler, javax.swing.plaf.synth.SynthSpinnerUI.EditorFocusHandler, javax.swing.plaf.synth.SynthTextAreaUI.Handler, javax.swing.plaf.synth.SynthTextFieldUI.Handler, javax.swing.text.DefaultCaret, javax.swing.text.JTextComponent.MutableCaretEvent, sun.awt.X11.XTextAreaPeer.AWTTextPane, sun.print.ServiceDialog.PrintRangePanel, sun.print.ServiceDialog.MarginsPanel, sun.print.ServiceDialog.JobAttributesPanel, java.awt.AWTEventMulticaster, java.awt.Component.AccessibleAWTComponent.AccessibleAWTFocusHandler, java.awt.event.FocusAdapter
Imports
java.util.EventListener

The listener interface for receiving keyboard focus events on a component. The class that is interested in processing a focus event either implements this interface (and all the methods it contains) or extends the abstract FocusAdapter class (overriding only the methods of interest). The listener object created from that class is then registered with a component using the component's addFocusListener method. When the component gains or loses the keyboard focus, the relevant method in the listener object is invoked, and the FocusEvent is passed to it.
Author
Carl Quinn
Since
1.1
See Also
FocusAdapter, FocusEvent, Tutorial: Writing a Focus Listener

Method Summary

Modifier and TypeMethod and Description
public void
focusGained(FocusEvent
the event to be processed
e
)

Invoked when a component gains the keyboard focus.

public void
focusLost(FocusEvent
the event to be processed
e
)

Invoked when a component loses the keyboard focus.

Method Detail

focusGainedback to summary
public void focusGained(FocusEvent e)

Invoked when a component gains the keyboard focus.

Parameters
e:FocusEvent

the event to be processed

focusLostback to summary
public void focusLost(FocusEvent e)

Invoked when a component loses the keyboard focus.

Parameters
e:FocusEvent

the event to be processed