edu.rice.comp211.laundry.ui
Class DynamicAction
java.lang.Object
javax.swing.AbstractAction
edu.rice.comp211.laundry.ui.DynamicAction
- All Implemented Interfaces:
- ActionListener, Serializable, Cloneable, EventListener, Action
public class DynamicAction
- extends AbstractAction
Implementation of Action that invokes a method on an Object.
- Version:
- $Revision$
- See Also:
- Serialized Form
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
DynamicAction
public DynamicAction(Object target,
String methodName,
Object... args)
- Creates a dynamic action with the specified arguments. When the
actionPerformed method is invoked on this class the method identified
by methodName is invoked with the specified arguments.
- Parameters:
target
- the Object to invoke the method onmethodName
- name of the method to invokeargs
- the arguments to pass to the method
- Throws:
IllegalArgumentException
- if target or methodName is null
actionPerformed
public void actionPerformed(ActionEvent e)
- Action method. When invoked this will invoke the named method on
the object passed to the constructor.
- Parameters:
e
- the ActionEvent