DefaultTextAction Class
- public abstract class DefaultTextAction
extends DefaultAction
Action class that is useful for working in text components. It provides a
default means of using the action event to determine the text component that
fired the event.
-
Hierarchy
-
Object
DefaultAction
DefaultTextAction
-
All Implemented Interfaces
-
ActionListener
, EventListener
, IAction
, PropertyChangeListener
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultTextAction
public DefaultTextAction()
getFocusedComponent() Method
protected final JTextComponent
getFocusedComponent()
Gets the last text component that had focus, though it may not currently
have it.
Returns
- JTextComponent that last had focus, or
null
.
getTextComponent(ActionEvent) Method
protected final JTextComponent
getTextComponent(ActionEvent
e)
Attempts to identify a text action associated with the given event.
If the event is null
, or no text component can be identified, this method
returns the focused JTextComponent.
Parameters
-
e
- The event that fired this action.
Returns
- The text component this action should run on.