JavaTM 2 Platform
Standard Ed. 6

接口 java.awt.event.ActionListener
的使用

使用 ActionListener 的软件包
java.awt 包含用于创建用户界面和绘制图形图像的所有类。 
java.awt.dnd Drag 和 Drop 是一种直接操作动作,在许多图形用户界面系统中都会遇到它,它提供了一种机制,能够在两个与 GUI 中显示元素逻辑相关的实体之间传输信息。 
javax.swing 提供一组“轻量级”(全部是 Java 语言)组件,尽量让这些组件在所有平台上的工作方式都相同。 
javax.swing.plaf.basic 提供了根据基本外观构建的用户界面对象。 
javax.swing.plaf.metal 提供根据 Java 外观(曾经代称为 Metal)构建的用户界面对象,Java 外观是默认外观。 
javax.swing.text 提供类 HTMLEditorKit 和创建 HTML 文本编辑器的支持类。 
javax.swing.text.html 提供类 HTMLEditorKit 和创建 HTML 文本编辑器的支持类。 
javax.swing.tree 提供处理 javax.swing.JTree 的类和接口。 
 

java.awtActionListener 的使用
 

实现 ActionListenerjava.awt 中的类
 class AWTEventMulticaster
          AWTEventMulticaster 实现对 java.awt.event 包中定义的 AWT 事件的指派,该指派是有效的、线程安全的多路广播事件指派。
protected  class List.AccessibleAWTList
          此类实现 List 类的可访问性支持。
 

返回 ActionListenerjava.awt 中的方法
static ActionListener AWTEventMulticaster.add(ActionListener a, ActionListener b)
          添加操作侦听器 a 和操作侦听器 b,并返回得到的多路广播侦听器。
 ActionListener[] Button.getActionListeners()
          返回在此按钮上注册的所有动作侦听器的一个数组。
 ActionListener[] List.getActionListeners()
          返回已在此列表上注册的所有动作侦听器的数组。
 ActionListener[] TextField.getActionListeners()
          返回此文本字段上已注册的所有操作侦听器的数组。
 ActionListener[] TrayIcon.getActionListeners()
          返回在已此 TrayIcon 上注册的所有动作侦听器的数组。
 ActionListener[] MenuItem.getActionListeners()
          返回在此菜单项上注册的所有动作侦听器组成的数组。
static ActionListener AWTEventMulticaster.remove(ActionListener l, ActionListener oldl)
          从操作侦听器 l 中移除旧的操作侦听器,并返回得到的多路广播侦听器。
 

参数类型为 ActionListenerjava.awt 中的方法
static ActionListener AWTEventMulticaster.add(ActionListener a, ActionListener b)
          添加操作侦听器 a 和操作侦听器 b,并返回得到的多路广播侦听器。
 void Button.addActionListener(ActionListener l)
          添加指定的动作侦听器,以接收发自此按钮的动作事件。
 void List.addActionListener(ActionListener l)
          添加指定的动作侦听器以从此列表接收动作事件。
 void TextField.addActionListener(ActionListener l)
          添加指定的操作侦听器,以从此文本字段接收操作事件。
 void TrayIcon.addActionListener(ActionListener listener)
          添加指定的动作侦听器,以接收发自此 TrayIconActionEvent
 void MenuItem.addActionListener(ActionListener l)
          添加指定的动作侦听器,以从此菜单项接收动作事件。
static ActionListener AWTEventMulticaster.remove(ActionListener l, ActionListener oldl)
          从操作侦听器 l 中移除旧的操作侦听器,并返回得到的多路广播侦听器。
 void Button.removeActionListener(ActionListener l)
          移除指定的动作侦听器,以便它不再接收发自此按钮的动作事件。
 void List.removeActionListener(ActionListener l)
          移除指定的动作侦听器,以便不再从此列表接收动作事件。
 void TextField.removeActionListener(ActionListener l)
          移除指定的操作侦听器,不再从此文本字段接收操作事件。
 void TrayIcon.removeActionListener(ActionListener listener)
          移除指定的动作侦听器。
 void MenuItem.removeActionListener(ActionListener l)
          移除指定的动作侦听器,使其不再从此菜单项中接收动作事件。
 

java.awt.dndActionListener 的使用
 

实现 ActionListenerjava.awt.dnd 中的类
protected static class DropTarget.DropTargetAutoScroller
          此受保护的嵌套类实现自动滚动
 

javax.swingActionListener 的使用
 

javax.swingActionListener 的子接口
 interface Action
          Action 接口提供 ActionListener 接口的一个有用扩展,以便若干控件访问相同的功能。
 

实现 ActionListenerjavax.swing 中的类
 class AbstractAction
          此类提供 JFC Action 接口的默认实现。
protected  class DefaultCellEditor.EditorDelegate
          受保护的 (protected) EditorDelegate 类。
 class JComboBox
          将按钮或可编辑字段与下拉列表组合的组件。
protected  class ToolTipManager.insideTimerAction
           
protected  class ToolTipManager.outsideTimerAction
           
protected  class ToolTipManager.stillInsideTimerAction
           
 

声明为 ActionListenerjavax.swing 中的字段
protected  ActionListener AbstractButton.actionListener
          按钮模型的 ActionListener
 

返回 ActionListenerjavax.swing 中的方法
protected  ActionListener AbstractButton.createActionListener()
           
 ActionListener JComponent.getActionForKeyStroke(KeyStroke aKeyStroke)
          返回执行针对给定键击而注册的操作的对象。
 ActionListener[] JFileChooser.getActionListeners()
          返回在此文件选择器上注册的所有操作侦听器的数组。
 ActionListener[] JTextField.getActionListeners()
          返回通过 addActionListener() 添加到此 JTextField 中的所有 ActionListener 的数组。
 ActionListener[] JComboBox.getActionListeners()
          返回使用 addActionListener() 添加到此 JComboBox 的所有 ActionListener 组成的数组。
 ActionListener[] DefaultButtonModel.getActionListeners()
          返回此 DefaultButtonModel 上所有已注册的操作侦听器组成的数组。
 ActionListener[] Timer.getActionListeners()
          返回已在此计时器上注册的所有动作侦听器所组成的数组。
 ActionListener[] AbstractButton.getActionListeners()
          返回使用 addActionListener() 添加到此 AbstractButton 的所有 ActionListener 组成的数组。
 

参数类型为 ActionListenerjavax.swing 中的方法
 void JFileChooser.addActionListener(ActionListener l)
          向文件选择器添加一个 ActionListener
 void JTextField.addActionListener(ActionListener l)
          添加指定的操作侦听器以从此文本字段接收操作事件。
 void ComboBoxEditor.addActionListener(ActionListener l)
          添加一个 ActionListener。
 void JComboBox.addActionListener(ActionListener l)
          添加 ActionListener
 void DefaultButtonModel.addActionListener(ActionListener l)
          向模型添加一个 ActionListener
 void ButtonModel.addActionListener(ActionListener l)
          向模型添加一个 ActionListener
 void Timer.addActionListener(ActionListener listener)
          将一个动作侦听器添加到 Timer
 void AbstractButton.addActionListener(ActionListener l)
          将一个 ActionListener 添加到按钮中。
static JDialog JColorChooser.createDialog(Component c, String title, boolean modal, JColorChooser chooserPane, ActionListener okListener, ActionListener cancelListener)
          创建并返回包含指定 ColorChooser 窗格及 "OK"、"Cancel" 和 "Reset" 按钮的新对话框。
 void JComponent.registerKeyboardAction(ActionListener anAction, KeyStroke aKeyStroke, int aCondition)
          此方法现在已过时,对于类似的操作,请结合使用 getActionMap()getInputMap()
 void JComponent.registerKeyboardAction(ActionListener anAction, String aCommand, KeyStroke aKeyStroke, int aCondition)
          此方法现在已过时,对于类似的操作,请结合使用 getActionMap()getInputMap()
 void JFileChooser.removeActionListener(ActionListener l)
          从文件选择器中移除一个 ActionListener
 void JTextField.removeActionListener(ActionListener l)
          移除指定的操作侦听器,以便不再从此文本字段接收操作事件。
 void ComboBoxEditor.removeActionListener(ActionListener l)
          移除一个 ActionListener
 void JComboBox.removeActionListener(ActionListener l)
          移除 ActionListener
 void DefaultButtonModel.removeActionListener(ActionListener l)
          从模型中移除一个 ActionListener
 void ButtonModel.removeActionListener(ActionListener l)
          从模型中移除一个 ActionListener
 void Timer.removeActionListener(ActionListener listener)
          从 Timer 移除指定的动作侦听器。
 void AbstractButton.removeActionListener(ActionListener l)
          从按钮中移除一个 ActionListener
 

参数类型为 ActionListenerjavax.swing 中的构造方法
Timer(int delay, ActionListener listener)
          创建一个 Timer 并将初始延迟和事件间延迟初始化为 delay 毫秒。
 

javax.swing.plaf.basicActionListener 的使用
 

实现 ActionListenerjavax.swing.plaf.basic 中的类
protected  class BasicDesktopPaneUI.CloseAction
          处理关闭一个内部窗体。
protected  class BasicDesktopPaneUI.MaximizeAction
          处理最大化一个内部窗体。
protected  class BasicDesktopPaneUI.MinimizeAction
          处理最小化一个内部窗体。
protected  class BasicDesktopPaneUI.NavigateAction
          处理导航到下一个内部窗体。
protected  class BasicDesktopPaneUI.OpenAction
          处理恢复一个最小化或最大化的内部窗体。
protected  class BasicFileChooserUI.ApproveSelectionAction
          响应 Open 或 Save 请求
protected  class BasicFileChooserUI.CancelSelectionAction
          响应取消请求。
protected  class BasicFileChooserUI.ChangeToParentDirectoryAction
           
protected  class BasicFileChooserUI.GoHomeAction
          基于“Home”键事件或等效事件的动作。
protected  class BasicFileChooserUI.NewFolderAction
          创建新文件夹。
protected  class BasicFileChooserUI.UpdateAction
          重新扫描当前目录中的文件。
 class BasicInternalFrameTitlePane.CloseAction
          此类应视为“受保护”内部类。
 class BasicInternalFrameTitlePane.IconifyAction
          此类应视为“受保护”内部类。
 class BasicInternalFrameTitlePane.MaximizeAction
          此类应视为“受保护”内部类。
 class BasicInternalFrameTitlePane.MoveAction
          此类应视为“受保护”内部类。
 class BasicInternalFrameTitlePane.RestoreAction
          此类应视为“受保护”内部类。
 class BasicInternalFrameTitlePane.SizeAction
          此类应视为“受保护”内部类。
 class BasicOptionPaneUI.ButtonActionListener
          此内部类因编译器故障而被标记为“公开”。
protected  class BasicScrollBarUI.ScrollListener
          在 ScrollPane 中发起的滚动事件的侦听器。
 class BasicSliderUI.ActionScroller
          从 Java 2 平台 v1.3 开始,不再使用这种以前没有记录的类。
 class BasicSliderUI.ScrollListener
          滚动事件侦听器。
 class BasicSplitPaneUI.KeyboardDownRightHandler
          ActionListener 的实现,JSplitPane UI 使用此实现处理特定键按下事件。
 class BasicSplitPaneUI.KeyboardEndHandler
          ActionListener 的实现,JSplitPane UI 使用此实现处理特定键按下事件。
 class BasicSplitPaneUI.KeyboardHomeHandler
          ActionListener 的实现,JSplitPane UI 使用此实现处理特定键按下事件。
 class BasicSplitPaneUI.KeyboardResizeToggleHandler
          ActionListener 的实现,JSplitPane UI 使用此实现处理特定键按下事件。
 class BasicSplitPaneUI.KeyboardUpLeftHandler
          ActionListener 的实现,JSplitPane UI 使用此实现处理特定键按下事件。
 class BasicTreeUI.ComponentHandler
          滚动时更新首选大小(如果需要)。
 class BasicTreeUI.TreeCancelEditingAction
          执行操作时调用 cancelEditing 的 ActionListener。
 class BasicTreeUI.TreeHomeAction
          TreeHomeAction 用于处理 end/home 动作。
 class BasicTreeUI.TreeIncrementAction
          TreeIncrementAction 用于处理向上/向下操作。
 class BasicTreeUI.TreePageAction
          TreePageAction 处理向上翻页和向下翻页事件。
 class BasicTreeUI.TreeToggleAction
          对于第一个选定行展开将被切换。
 class BasicTreeUI.TreeTraverseAction
          TreeTraverseAction 是用于向左/向右方向键的动作。
 

声明为 ActionListenerjavax.swing.plaf.basic 中的字段
protected  ActionListener BasicSplitPaneUI.keyboardDownRightListener
          已过时。 从 Java 2 platform v1.3 开始。
protected  ActionListener BasicSplitPaneUI.keyboardEndListener
          已过时。 从 Java 2 platform v1.3 开始。
protected  ActionListener BasicSplitPaneUI.keyboardHomeListener
          已过时。 从 Java 2 platform v1.3 开始。
protected  ActionListener BasicSplitPaneUI.keyboardResizeToggleListener
          已过时。 从 Java 2 platform v1.3 开始。
protected  ActionListener BasicSplitPaneUI.keyboardUpLeftListener
          已过时。 从 Java 2 platform v1.3 开始。
 

返回 ActionListenerjavax.swing.plaf.basic 中的方法
protected  ActionListener BasicOptionPaneUI.createButtonActionListener(int buttonIndex)
           
protected  ActionListener BasicSplitPaneUI.createKeyboardDownRightListener()
          已过时。 从 Java 2 platform v1.3 开始。
protected  ActionListener BasicSplitPaneUI.createKeyboardEndListener()
          已过时。 从 Java 2 platform v1.3 开始。
protected  ActionListener BasicSplitPaneUI.createKeyboardHomeListener()
          已过时。 从 Java 2 platform v1.3 开始。
protected  ActionListener BasicSplitPaneUI.createKeyboardResizeToggleListener()
          已过时。 从 Java 2 platform v1.3 开始。
protected  ActionListener BasicSplitPaneUI.createKeyboardUpLeftListener()
          已过时。 从 Java 2 platform v1.3 开始。
 

参数类型为 ActionListenerjavax.swing.plaf.basic 中的方法
 void BasicComboBoxEditor.addActionListener(ActionListener l)
           
 void BasicComboBoxEditor.removeActionListener(ActionListener l)
           
 

javax.swing.plaf.metalActionListener 的使用
 

实现 ActionListenerjavax.swing.plaf.metal 中的类
protected  class MetalFileChooserUI.DirectoryComboBoxAction
          当 DirectoryComboBox 已更改所选项时调用。
 

javax.swing.textActionListener 的使用
 

实现 ActionListenerjavax.swing.text 中的类
static class DefaultEditorKit.BeepAction
          创建蜂鸣声。
static class DefaultEditorKit.CopyAction
          复制选定的区域并将其内容放入系统剪贴板中。
static class DefaultEditorKit.CutAction
          剪切选定的区域并将其内容放入系统剪贴板中。
static class DefaultEditorKit.DefaultKeyTypedAction
          如果接收到键输入事件 并且无 keymap 输入,则默认执行该动作。
static class DefaultEditorKit.InsertBreakAction
          在文档中放置行/段落中断。
static class DefaultEditorKit.InsertContentAction
          将内容置于关联的文档中。
static class DefaultEditorKit.InsertTabAction
          将一个制表符置于文档中。
static class DefaultEditorKit.PasteAction
          将系统剪贴板内容粘贴到选定区域,如果未选中任何内容,则粘贴到插入符前面。
static class StyledEditorKit.AlignmentAction
          设置段落对齐的操作。
static class StyledEditorKit.BoldAction
          切换粗体属性的操作。
static class StyledEditorKit.FontFamilyAction
          在相关的 JEditorPane 中设置字体系列的操作。
static class StyledEditorKit.FontSizeAction
          设置关联的 JEditorPane 中字体大小的操作。
static class StyledEditorKit.ForegroundAction
          设置前景色的操作。
static class StyledEditorKit.ItalicAction
          切换斜体属性的一种操作。
static class StyledEditorKit.StyledTextAction
          假定是在安装有 StyledEditorKit(或者子类)的 JEditorPane 上触发的操作。
static class StyledEditorKit.UnderlineAction
          切换下划线属性的操作。
 class TextAction
          用于跨多个不同文本组件共享的键绑定的 Action 实现。
 

javax.swing.text.htmlActionListener 的使用
 

实现 ActionListenerjavax.swing.text.html 中的类
 class FormView
          实现表单元素、<input>、<textarea> 和 <select> 的视图接口的组件装饰符。
static class HTMLEditorKit.HTMLTextAction
          提供某些便捷方法的抽象 Action,这些便捷方法对于将 HTML 插入现有文档可能很有用。
static class HTMLEditorKit.InsertHTMLTextAction
          InsertHTMLTextAction 可用于将任意 HTML 字符串插入现有 HTML 文档。
 

javax.swing.treeActionListener 的使用
 

实现 ActionListenerjavax.swing.tree 中的类
 class DefaultTreeCellEditor
          TreeCellEditor
 


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only