public void setAction (Action a)

Sets the Action for the ActionEvent source. The new Action replaces any previously set Action but does not affect ActionListeners independently added with addActionListener. If the Action is already a registered ActionListener for the ActionEvent source, it is not re-registered.

Setting the Action results in immediately changing all the properties described in Swing Components Supporting Action. Subsequently, the textfield's properties are automatically updated as the Action's properties change.

This method uses three other methods to set and help track the Action's property values. It uses the configurePropertiesFromAction method to immediately change the textfield's properties. To track changes in the Action's property values, this method registers the PropertyChangeListener returned by createActionPropertyChangeListener. The default PropertyChangeListener invokes the actionPropertyChanged method when a property in the Action changes.

Parameters:
a    the Action for the JTextField, or null

See also:
Action, getAction, configurePropertiesFromAction, createActionPropertyChangeListener, actionPropertyChanged

Since:  1.3

@beaninfo bound: true attribute: visualUpdate true description: the Action instance connected with this ActionEvent source