The FocusAdapter class implements the methods of FocusListener with empty functions. It may be easier for you to extend FocusAdapter, overriding only those methods you are interested in, than to implement FocusListener and provide the empty functions yourself.
public abstract class java.awt.event.FocusAdapter extends java.lang.Object implements java.awt.event.FocusListener { // Instance Methods public void focusGained (FocusEvent e); public void focusLost (FocusEvent e); }
The event that has occurred.
Does nothing. Override this function to be notified when a component gains focus.
The event that has occurred.
Does nothing. Override this function to be notified when a component loses focus.
FocusEvent, FocusListener