Package bdsup2sub.gui.support
Class RequestFocusListener
java.lang.Object
bdsup2sub.gui.support.RequestFocusListener
- All Implemented Interfaces:
EventListener
,AncestorListener
Convenience class to request focus on a component.
When the component is added to a realized Window then component will
request focus immediately, since the ancestorAdded event is fired
immediately.
When the component is added to a non realized Window, then the focus
request will be made once the window is realized, since the
ancestorAdded event will not be fired until then.
Using the default constructor will cause the listener to be removed
from the component once the AncestorEvent is generated. A second constructor
allows you to specify a boolean value of false to prevent the
AncestorListener from being removed when the event is generated. This will
allow you to reuse the listener each time the event is generated.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
-
Field Details
-
removeListener
private boolean removeListener
-
-
Constructor Details
-
RequestFocusListener
public RequestFocusListener() -
RequestFocusListener
public RequestFocusListener(boolean removeListener)
-
-
Method Details
-
ancestorAdded
- Specified by:
ancestorAdded
in interfaceAncestorListener
-
ancestorMoved
- Specified by:
ancestorMoved
in interfaceAncestorListener
-
ancestorRemoved
- Specified by:
ancestorRemoved
in interfaceAncestorListener
-