Package org.jfree.ui
Class JTextObserver
java.lang.Object
org.jfree.ui.JTextObserver
- All Implemented Interfaces:
FocusListener
,EventListener
An observer that selects all the text when a field gains the focus.
- Author:
- Thomas Morgner
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Adds this instance as a listener for the specified text component.void
Selects all the text when a field gains the focus.void
Deselects the text when a field loses the focus.static JTextObserver
Returns the single instance.static void
Removes this instance as a listener for the specified text component.
-
Method Details
-
getInstance
Returns the single instance.- Returns:
- The single instance.
-
focusGained
Selects all the text when a field gains the focus.- Specified by:
focusGained
in interfaceFocusListener
- Parameters:
e
- the focus event.
-
focusLost
Deselects the text when a field loses the focus.- Specified by:
focusLost
in interfaceFocusListener
- Parameters:
e
- the event.
-
addTextComponent
Adds this instance as a listener for the specified text component.- Parameters:
t
- the text component.
-
removeTextComponent
Removes this instance as a listener for the specified text component.- Parameters:
t
- the text component.
-