... button = new JButton(leftAction) ... menuItem = new JMenuItem(leftAction); To create an Action object, you generally create a subclass of AbstractAction and then instantiate it. In your subclass, you must implement the actionPerformed method to react appropriately when the action event occurs. Here's an example of creating and instantiating an AbstractAction subclass: leftAction = new LeftAction("Go left", anIcon, "This is the left button.", new Integer(KeyEvent.VK_L)); -- A snapshot of ActionDemo when A snapshot of ActionDemo when Here's the code that disables the "Go left" action: boolean selected = ...//true if the action should be enabled; //false, otherwise leftAction.setEnabled(selected); After you create components using an Action, you might well need to customize them. For example, you might want to customize the appearance of one of the components by adding or deleting the icon or text. For example, ActionDemo.java has no icons in its menus, and no text in its buttons. Here's the code that accomplishes this: menuItem = new JMenuItem(); menuItem.setAction(leftAction);