- java.lang.Object
-
- com.sun.java.accessibility.util.AWTEventMonitor
-
- 已知直接子类:
-
SwingEventMonitor
public class AWTEventMonitor extends Object
AWTEventMonitor实现了一组侦听器,这些侦听器有条件地安装在Java虚拟机中的每个AWT组件实例上。 这些侦听器捕获的事件通过AWTEventMonitor支持的统一侦听器集提供。 这样,每个AWT组件实例上的所有单个事件都会汇集到按类别细分的一组侦听器中(有关类别,请参阅EventID)。此类依赖于
EventQueueMonitor,它提供了在创建顶级容器时捕获它们的基本级别支持。
-
-
字段汇总
字段 变量和类型 字段 描述 protected static ActionListeneractionListener不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用。protected static AdjustmentListeneradjustmentListener不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用。protected static ComponentListenercomponentListener不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用。protected static ComponentcomponentWithFocus不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用; 获取具有焦点的组件使用getComponentWithFocus方法。protected static ContainerListenercontainerListener不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用。protected static FocusListenerfocusListener不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用。protected static ItemListeneritemListener不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用。protected static KeyListenerkeyListener不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用。protected static MouseListenermouseListener不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用。protected static MouseMotionListenermouseMotionListener不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用。protected static TextListenertextListener不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用。protected static WindowListenerwindowListener不推荐使用,要删除:此API元素将在以后的版本中删除。该字段未使用。
-
构造方法摘要
构造方法 构造器 描述 AWTEventMonitor()
-
方法摘要
所有方法 静态方法 具体的方法 变量和类型 方法 描述 static voidaddActionListener(ActionListener l)添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有ACTION事件。static voidaddAdjustmentListener(AdjustmentListener l)添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有ADJUSTMENT事件。static voidaddComponentListener(ComponentListener l)添加指定的侦听器,以便在Java虚拟机中的每个组件实例上发生所有COMPONENT事件。static voidaddContainerListener(ContainerListener l)添加指定的侦听器,以便在Java虚拟机中的每个组件实例上发生所有CONTAINER事件。static voidaddFocusListener(FocusListener l)添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有FOCUS事件。static voidaddItemListener(ItemListener l)添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有ITEM事件。static voidaddKeyListener(KeyListener l)添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有KEY事件。static voidaddMouseListener(MouseListener l)添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有MOUSE事件。static voidaddMouseMotionListener(MouseMotionListener l)添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有鼠标MOTION事件。static voidaddTextListener(TextListener l)添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有TEXT事件。static voidaddWindowListener(WindowListener l)添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有WINDOW事件。static ComponentgetComponentWithFocus()返回当前具有键盘焦点的组件。static voidremoveActionListener(ActionListener l)删除指定的侦听器,以便它们在发生时不再接收ACTION事件。static voidremoveAdjustmentListener(AdjustmentListener l)删除指定的侦听器,以便它们在发生时不再接收ADJUSTMENT个事件。static voidremoveComponentListener(ComponentListener l)删除指定的侦听器,以便它们在发生时不再接收COMPONENT个事件。static voidremoveContainerListener(ContainerListener l)删除指定的侦听器,以便它们在发生时不再接收CONTAINER个事件。static voidremoveFocusListener(FocusListener l)删除指定的侦听器,以便它们在发生时不再接收FOCUS事件。static voidremoveItemListener(ItemListener l)删除指定的侦听器,以便它们在发生时不再接收ITEM个事件。static voidremoveKeyListener(KeyListener l)删除指定的侦听器,以便它们在发生时不再接收KEY个事件。static voidremoveMouseListener(MouseListener l)删除指定的侦听器,以便它们在发生时不再接收MOUSE个事件。static voidremoveMouseMotionListener(MouseMotionListener l)删除指定的侦听器,以便它们在发生时不再接收MOTION个事件。static voidremoveTextListener(TextListener l)删除指定的侦听器,以便它们在发生时不再接收TEXT事件。static voidremoveWindowListener(WindowListener l)删除指定的侦听器,以便它们在发生时不再接收WINDOW个事件。
-
-
-
字段详细信息
-
componentWithFocus
@Deprecated(since="8", forRemoval=true) protected static Component componentWithFocus
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused; to get the component with focus use the getComponentWithFocus method.具有键盘焦点的当前组件。- 另请参见:
-
getComponentWithFocus()
-
componentListener
@Deprecated(since="8", forRemoval=true) protected static ComponentListener componentListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.已注册的ComponentListener类的当前列表。
-
containerListener
@Deprecated(since="8", forRemoval=true) protected static ContainerListener containerListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.已注册的ContainerListener类的当前列表。
-
focusListener
@Deprecated(since="8", forRemoval=true) protected static FocusListener focusListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.已注册的FocusListener类的当前列表。
-
keyListener
@Deprecated(since="8", forRemoval=true) protected static KeyListener keyListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.已注册的KeyListener类的当前列表。
-
mouseListener
@Deprecated(since="8", forRemoval=true) protected static MouseListener mouseListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.已注册的MouseListener类的当前列表。
-
mouseMotionListener
@Deprecated(since="8", forRemoval=true) protected static MouseMotionListener mouseMotionListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.已注册的MouseMotionListener类的当前列表。
-
windowListener
@Deprecated(since="8", forRemoval=true) protected static WindowListener windowListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.注册的WindowListener类的当前列表。
-
actionListener
@Deprecated(since="8", forRemoval=true) protected static ActionListener actionListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.已注册的ActionListener类的当前列表。
-
adjustmentListener
@Deprecated(since="8", forRemoval=true) protected static AdjustmentListener adjustmentListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.已注册的AdjustmentListener类的当前列表。
-
itemListener
@Deprecated(since="8", forRemoval=true) protected static ItemListener itemListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.已注册的ItemListener类的当前列表。
-
textListener
@Deprecated(since="8", forRemoval=true) protected static TextListener textListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.已注册的TextListener类的当前列表。
-
-
方法详细信息
-
getComponentWithFocus
public static Component getComponentWithFocus()
返回当前具有键盘焦点的组件。 返回值可以为null。- 结果
- 具有键盘焦点的组件
-
addComponentListener
public static void addComponentListener(ComponentListener l)
添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有COMPONENT事件。注意:此侦听器将自动添加到调用此方法后创建的所有组件实例中。 此外,它仅添加到支持此侦听器类型的组件实例。
- 参数
-
l- 要添加的侦听器 - 另请参见:
-
removeComponentListener(java.awt.event.ComponentListener)
-
removeComponentListener
public static void removeComponentListener(ComponentListener l)
删除指定的侦听器,以便它们在发生时不再接收COMPONENT事件。- 参数
-
l- 要删除的侦听器 - 另请参见:
-
addComponentListener(java.awt.event.ComponentListener)
-
addContainerListener
public static void addContainerListener(ContainerListener l)
添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有CONTAINER事件。注意:此侦听器将自动添加到调用此方法后创建的所有组件实例中。 此外,它仅添加到支持此侦听器类型的组件实例。
- 参数
-
l- 要添加的侦听器 - 另请参见:
-
removeContainerListener(java.awt.event.ContainerListener)
-
removeContainerListener
public static void removeContainerListener(ContainerListener l)
删除指定的侦听器,以便它们在发生时不再接收CONTAINER个事件。- 参数
-
l- 要删除的侦听器 - 另请参见:
-
addContainerListener(java.awt.event.ContainerListener)
-
addFocusListener
public static void addFocusListener(FocusListener l)
添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有FOCUS事件。注意:此侦听器将自动添加到调用此方法后创建的所有组件实例中。 此外,它仅添加到支持此侦听器类型的组件实例。
- 参数
-
l- 要添加的侦听器 - 另请参见:
-
removeFocusListener(java.awt.event.FocusListener)
-
removeFocusListener
public static void removeFocusListener(FocusListener l)
删除指定的侦听器,以便它们在发生时不再接收FOCUS事件。- 参数
-
l- 要删除的侦听器 - 另请参见:
-
addFocusListener(java.awt.event.FocusListener)
-
addKeyListener
public static void addKeyListener(KeyListener l)
添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有KEY事件。注意:此侦听器将自动添加到调用此方法后创建的所有组件实例中。 此外,它仅添加到支持此侦听器类型的组件实例。
- 参数
-
l- 要添加的侦听器 - 另请参见:
-
removeKeyListener(java.awt.event.KeyListener)
-
removeKeyListener
public static void removeKeyListener(KeyListener l)
删除指定的侦听器,以便它们在发生时不再接收KEY事件。- 参数
-
l- 要删除的侦听器 - 另请参见:
-
addKeyListener(java.awt.event.KeyListener)
-
addMouseListener
public static void addMouseListener(MouseListener l)
添加指定的侦听器,以便在Java虚拟机中的每个组件实例上发生所有MOUSE事件。注意:此侦听器将自动添加到调用此方法后创建的所有组件实例中。 此外,它仅添加到支持此侦听器类型的组件实例。
- 参数
-
l- 要添加的侦听器 - 另请参见:
-
removeMouseListener(java.awt.event.MouseListener)
-
removeMouseListener
public static void removeMouseListener(MouseListener l)
删除指定的侦听器,以便它们在发生时不再接收MOUSE个事件。- 参数
-
l- 要删除的侦听器 - 另请参见:
-
addMouseListener(java.awt.event.MouseListener)
-
addMouseMotionListener
public static void addMouseMotionListener(MouseMotionListener l)
添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有鼠标MOTION事件。注意:此侦听器将自动添加到调用此方法后创建的所有组件实例中。 此外,它仅添加到支持此侦听器类型的组件实例。
- 参数
-
l- 要添加的侦听器 - 另请参见:
-
removeMouseMotionListener(java.awt.event.MouseMotionListener)
-
removeMouseMotionListener
public static void removeMouseMotionListener(MouseMotionListener l)
删除指定的侦听器,以便它们在发生时不再接收MOTION个事件。- 参数
-
l- 要删除的侦听器 - 另请参见:
-
addMouseMotionListener(java.awt.event.MouseMotionListener)
-
addWindowListener
public static void addWindowListener(WindowListener l)
添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有WINDOW事件。注意:此侦听器将自动添加到调用此方法后创建的所有组件实例中。 此外,它仅添加到支持此侦听器类型的组件实例。
- 参数
-
l- 要添加的侦听器 - 另请参见:
-
removeWindowListener(java.awt.event.WindowListener)
-
removeWindowListener
public static void removeWindowListener(WindowListener l)
删除指定的侦听器,以便它们在发生时不再接收WINDOW事件。- 参数
-
l- 要删除的侦听器 - 另请参见:
-
addWindowListener(java.awt.event.WindowListener)
-
addActionListener
public static void addActionListener(ActionListener l)
添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有ACTION事件。注意:此侦听器将自动添加到调用此方法后创建的所有组件实例中。 此外,它仅添加到支持此侦听器类型的组件实例。
- 参数
-
l- 要添加的侦听器 - 另请参见:
-
removeActionListener(java.awt.event.ActionListener)
-
removeActionListener
public static void removeActionListener(ActionListener l)
删除指定的侦听器,以便它们在发生时不再接收ACTION个事件。- 参数
-
l- 要删除的侦听器 - 另请参见:
-
addActionListener(java.awt.event.ActionListener)
-
addAdjustmentListener
public static void addAdjustmentListener(AdjustmentListener l)
添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有ADJUSTMENT事件。注意:此侦听器将自动添加到调用此方法后创建的所有组件实例中。 此外,它仅添加到支持此侦听器类型的组件实例。
- 参数
-
l- 要添加的侦听器 - 另请参见:
-
removeAdjustmentListener(java.awt.event.AdjustmentListener)
-
removeAdjustmentListener
public static void removeAdjustmentListener(AdjustmentListener l)
删除指定的侦听器,以便它们在发生时不再接收ADJUSTMENT个事件。- 参数
-
l- 要删除的侦听器 - 另请参见:
-
addAdjustmentListener(java.awt.event.AdjustmentListener)
-
addItemListener
public static void addItemListener(ItemListener l)
添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有ITEM事件。注意:此侦听器将自动添加到调用此方法后创建的所有组件实例中。 此外,它仅添加到支持此侦听器类型的组件实例。
- 参数
-
l- 要添加的侦听器 - 另请参见:
-
removeItemListener(java.awt.event.ItemListener)
-
removeItemListener
public static void removeItemListener(ItemListener l)
删除指定的侦听器,以便它们在发生时不再接收ITEM个事件。- 参数
-
l- 要删除的侦听器 - 另请参见:
-
addItemListener(java.awt.event.ItemListener)
-
addTextListener
public static void addTextListener(TextListener l)
添加指定的侦听器以在Java虚拟机中的每个组件实例上发生所有TEXT事件。注意:此侦听器将自动添加到调用此方法后创建的所有组件实例中。 此外,它仅添加到支持此侦听器类型的组件实例。
- 参数
-
l- 要添加的侦听器 - 另请参见:
-
removeTextListener(java.awt.event.TextListener)
-
removeTextListener
public static void removeTextListener(TextListener l)
删除指定的侦听器,以便它们在发生时不再接收TEXT个事件。- 参数
-
l- 要删除的侦听器 - 另请参见:
-
addTextListener(java.awt.event.TextListener)
-
-