java.awt.event

Interface ActionListener

All Superinterfaces:
EventListener
Known Subinterfaces:
Action
Known Implementing Classes:
AbstractAction, ActionRouter, ArgumentsPanel, AWTEventMulticaster, BasicDesktopPaneUI.CloseAction, BasicDesktopPaneUI.MaximizeAction, BasicDesktopPaneUI.MinimizeAction, BasicDesktopPaneUI.NavigateAction, BasicDesktopPaneUI.OpenAction, BasicFileChooserUI.ApproveSelectionAction, BasicFileChooserUI.CancelSelectionAction, BasicFileChooserUI.ChangeToParentDirectoryAction, BasicFileChooserUI.GoHomeAction, BasicFileChooserUI.NewFolderAction, BasicFileChooserUI.UpdateAction, BasicInternalFrameTitlePane.CloseAction, BasicInternalFrameTitlePane.IconifyAction, BasicInternalFrameTitlePane.MaximizeAction, BasicInternalFrameTitlePane.MoveAction, BasicInternalFrameTitlePane.RestoreAction, BasicInternalFrameTitlePane.SizeAction, BasicOptionPaneUI.ButtonActionListener, BasicScrollBarUI.ScrollListener, BasicSliderUI.ActionScroller, BasicSliderUI.ScrollListener, BasicSplitPaneUI.KeyboardDownRightHandler, BasicSplitPaneUI.KeyboardEndHandler, BasicSplitPaneUI.KeyboardHomeHandler, BasicSplitPaneUI.KeyboardResizeToggleHandler, BasicSplitPaneUI.KeyboardUpLeftHandler, BasicTreeUI.ComponentHandler, BasicTreeUI.TreeCancelEditingAction, BasicTreeUI.TreeHomeAction, BasicTreeUI.TreeIncrementAction, BasicTreeUI.TreePageAction, BasicTreeUI.TreeToggleAction, BasicTreeUI.TreeTraverseAction, ChartPanel, CheckDirty, DefaultCellEditor.EditorDelegate, DefaultEditorKit.BeepAction, DefaultEditorKit.CopyAction, DefaultEditorKit.CutAction, DefaultEditorKit.DefaultKeyTypedAction, DefaultEditorKit.InsertBreakAction, DefaultEditorKit.InsertContentAction, DefaultEditorKit.InsertTabAction, DefaultEditorKit.PasteAction, DefaultTreeCellEditor, DropTarget.DropTargetAutoScroller, FileEditor, FileListPanel, FilePanel, FormView, FunctionHelper, GTKFileChooserUI.DirectoryComboBoxAction, HTMLEditorKit.HTMLTextAction, HTMLEditorKit.InsertHTMLTextAction, IfControllerPanel, JavaConfigGui, JComboBox, JUnitTestSamplerGui, List.AccessibleAWTList, LoopControlPanel, MetalFileChooserUI.DirectoryComboBoxAction, MotifDesktopIconUI.DesktopIconActionListener, MotifInternalFrameTitlePane, PasswordEditor, PolarChartPanel, RunTimeGui, SavePropertyDialog, SimpleConfigGui, StopWatchDisplay, StyledEditorKit.AlignmentAction, StyledEditorKit.BoldAction, StyledEditorKit.FontFamilyAction, StyledEditorKit.FontSizeAction, StyledEditorKit.ForegroundAction, StyledEditorKit.ItalicAction, StyledEditorKit.StyledTextAction, StyledEditorKit.UnderlineAction, TextAction, ToolTipManager.insideTimerAction, ToolTipManager.outsideTimerAction, ToolTipManager.stillInsideTimerAction, WhileControllerGui, WindowsFileChooserUI.DirectoryComboBoxAction, WindowsFileChooserUI.WindowsNewFolderAction

public interface ActionListener
extends EventListener

The listener interface for receiving action events. The class that is interested in processing an action event implements this interface, and the object created with that class is registered with a component, using the component's addActionListener method. When the action event occurs, that object's actionPerformed method is invoked.
Since:
1.1
See Also:
ActionEvent, Tutorial: Java 1.1 Event Model, Reference: The Java Class Libraries (update file)

Method Summary

void
actionPerformed(ActionEvent e)
Invoked when an action occurs.

Method Details

actionPerformed

public void actionPerformed(ActionEvent e)
Invoked when an action occurs.
Usages and Demos :

View More Examples of actionPerformed(ActionEvent e)
   1: import java.awt.event.ActionEvent;
   2: import java.awt.event.ActionListener;
   3: 
   4:         ...
   5:   private ObjectArrayList list;
   6:   private ActionListener listenerList;
   7:   public synchronized void 
   8:         ...
   9:       addActionListener(ActionListener t) {
  10:     listenerList = AWTEventMulticaster.add(listenerList, t);
  11:         ...
  12:       list, ActionEvent.ACTION_PERFORMED, "Adding " + size);
  13:     listenerList.actionPerformed(event);      

View Full Code Here
   1:   UndoableEditSupport undoableEditSupport = new UndoableEditSupport(this);
   2:   ActionListener actionListenerList = null;
   3: 
   4:         ...
   5:   public void addActionListener(ActionListener actionListener) {
   6:     actionListenerList = AWTEventMulticaster.add(actionListener, actionListenerList);
   7:         ...
   8:     if (actionListenerList != null) {
   9:       actionListenerList.actionPerformed(actionEvent);
  10:     }

View Full Code Here
   1: public class KeyTextComponent extends JComponent {
   2:   private ActionListener actionListenerList = null;
   3: 
   4:         ...
   5:             keyText);
   6:           actionListenerList.actionPerformed(actionEvent);
   7:         }
   8:         ...
   9: 
  10:   public void addActionListener(ActionListener actionListener) {
  11:     actionListenerList = AWTEventMulticaster.add(

View Full Code Here
   1: 
   2:    public void addActionListener(ActionListener listener)
   3:    {
   4:         ...
   5: 
   6:    public void removeActionListener(ActionListener listener)
   7:    {
   8:         ...
   9:       while (en.hasMoreElements()) {
  10:          ActionListener listener = (ActionListener)en.nextElement();
  11:         ...
  12:          listener.actionPerformed(e);

View Full Code Here
   1: import java.awt.event.ActionEvent;
   2: import java.awt.event.ActionListener;
   3: import javax.swing.Timer;
   4:         ...
   5: 
   6:   private ActionListener controlListener;
   7:   private ActionEvent standardAction, acceleratedAction;
   8:         ...
   9: 
  10:     timer=new Timer(tickLength, new ActionListener() {
  11:       public void actionPerformed(ActionEvent e) {
  12:         ...
  13:       if(ticks>accelerationLimit)
  14:         controlListener.actionPerformed(acceleratedAction);

View Full Code Here