- Direct Known Subclasses:
SwingEventMonitor
The AWTEventMonitor
implements a suite of listeners that are
conditionally installed on every AWT component instance in the Java
Virtual Machine. The events captured by these listeners are made
available through a unified set of listeners supported by AWTEventMonitor
.
With this, all the individual events on each of the AWT component
instances are funneled into one set of listeners broken down by category
(see EventID
for the categories).
This class depends upon EventQueueMonitor
, which provides the base
level support for capturing the top-level containers as they are created.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static ActionListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.protected static AdjustmentListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.protected static ComponentListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.protected static Component
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.protected static ContainerListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.protected static FocusListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.protected static ItemListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.protected static KeyListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.protected static MouseListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.protected static MouseMotionListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.protected static TextListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.protected static WindowListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Adds the specified listener to receive allACTION
events on each component instance in the Java Virtual Machine when they occur.static void
Adds the specified listener to receive allADJUSTMENT
events on each component instance in the Java Virtual Machine when they occur.static void
Adds the specified listener to receive allCOMPONENT
events on each component instance in the Java Virtual Machine as they occur.static void
Adds the specified listener to receive allCONTAINER
events on each component instance in the Java Virtual Machine as they occur.static void
Adds the specified listener to receive allFOCUS
events on each component instance in the Java Virtual Machine when they occur.static void
Adds the specified listener to receive allITEM
events on each component instance in the Java Virtual Machine when they occur.static void
Adds the specified listener to receive allKEY
events on each component instance in the Java Virtual Machine when they occur.static void
Adds the specified listener to receive allMOUSE
events on each component instance in the Java Virtual Machine when they occur.static void
Adds the specified listener to receive all mouseMOTION
events on each component instance in the Java Virtual Machine when they occur.static void
Adds the specified listener to receive allTEXT
events on each component instance in the Java Virtual Machine when they occur.static void
Adds the specified listener to receive allWINDOW
events on each component instance in the Java Virtual Machine when they occur.static Component
Returns the component that currently has keyboard focus.static void
Removes the specified listener so it no longer receivesACTION
events when they occur.static void
Removes the specified listener so it no longer receivesADJUSTMENT
events when they occur.static void
Removes the specified listener so it no longer receivesCOMPONENT
events when they occur.static void
Removes the specified listener so it no longer receivesCONTAINER
events when they occur.static void
Removes the specified listener so it no longer receivesFOCUS
events when they occur.static void
Removes the specified listener so it no longer receivesITEM
events when they occur.static void
Removes the specified listener so it no longer receivesKEY
events when they occur.static void
Removes the specified listener so it no longer receivesMOUSE
events when they occur.static void
Removes the specified listener so it no longer receivesMOTION
events when they occur.static void
Removes the specified listener so it no longer receivesTEXT
events when they occur.static void
Removes the specified listener so it no longer receivesWINDOW
events when they occur.
-
Field Details
-
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.The current component with keyboard focus.- See Also:
-
componentListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.The current list of registered ComponentListener classes. -
containerListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.The current list of registered ContainerListener classes. -
focusListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.The current list of registered FocusListener classes. -
keyListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.The current list of registered KeyListener classes. -
mouseListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.The current list of registered MouseListener classes. -
mouseMotionListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.The current list of registered MouseMotionListener classes. -
windowListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.The current list of registered WindowListener classes. -
actionListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.The current list of registered ActionListener classes. -
adjustmentListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.The current list of registered AdjustmentListener classes. -
itemListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.The current list of registered ItemListener classes. -
textListener
Deprecated, for removal: This API element is subject to removal in a future version.This field is unused.The current list of registered TextListener classes.
-
-
Constructor Details
-
AWTEventMonitor
public AWTEventMonitor()Constructs anAWTEventMonitor
.
-
-
Method Details
-
getComponentWithFocus
Returns the component that currently has keyboard focus. The return value can be null.- Returns:
- the component that has keyboard focus
-
addComponentListener
Adds the specified listener to receive allCOMPONENT
events on each component instance in the Java Virtual Machine as they occur.Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.
- Parameters:
l
- the listener to add- See Also:
-
removeComponentListener
Removes the specified listener so it no longer receivesCOMPONENT
events when they occur.- Parameters:
l
- the listener to remove- See Also:
-
addContainerListener
Adds the specified listener to receive allCONTAINER
events on each component instance in the Java Virtual Machine as they occur.Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.
- Parameters:
l
- the listener to add- See Also:
-
removeContainerListener
Removes the specified listener so it no longer receivesCONTAINER
events when they occur.- Parameters:
l
- the listener to remove- See Also:
-
addFocusListener
Adds the specified listener to receive allFOCUS
events on each component instance in the Java Virtual Machine when they occur.Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.
- Parameters:
l
- the listener to add- See Also:
-
removeFocusListener
Removes the specified listener so it no longer receivesFOCUS
events when they occur.- Parameters:
l
- the listener to remove- See Also:
-
addKeyListener
Adds the specified listener to receive allKEY
events on each component instance in the Java Virtual Machine when they occur.Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.
- Parameters:
l
- the listener to add- See Also:
-
removeKeyListener
Removes the specified listener so it no longer receivesKEY
events when they occur.- Parameters:
l
- the listener to remove- See Also:
-
addMouseListener
Adds the specified listener to receive allMOUSE
events on each component instance in the Java Virtual Machine when they occur.Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.
- Parameters:
l
- the listener to add- See Also:
-
removeMouseListener
Removes the specified listener so it no longer receivesMOUSE
events when they occur.- Parameters:
l
- the listener to remove- See Also:
-
addMouseMotionListener
Adds the specified listener to receive all mouseMOTION
events on each component instance in the Java Virtual Machine when they occur.Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.
- Parameters:
l
- the listener to add- See Also:
-
removeMouseMotionListener
Removes the specified listener so it no longer receivesMOTION
events when they occur.- Parameters:
l
- the listener to remove- See Also:
-
addWindowListener
Adds the specified listener to receive allWINDOW
events on each component instance in the Java Virtual Machine when they occur.Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.
- Parameters:
l
- the listener to add- See Also:
-
removeWindowListener
Removes the specified listener so it no longer receivesWINDOW
events when they occur.- Parameters:
l
- the listener to remove- See Also:
-
addActionListener
Adds the specified listener to receive allACTION
events on each component instance in the Java Virtual Machine when they occur.Note: This listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.
- Parameters:
l
- the listener to add- See Also:
-
removeActionListener
Removes the specified listener so it no longer receivesACTION
events when they occur.- Parameters:
l
- the listener to remove- See Also:
-
addAdjustmentListener
Adds the specified listener to receive allADJUSTMENT
events on each component instance in the Java Virtual Machine when they occur.Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.
- Parameters:
l
- the listener to add- See Also:
-
removeAdjustmentListener
Removes the specified listener so it no longer receivesADJUSTMENT
events when they occur.- Parameters:
l
- the listener to remove- See Also:
-
addItemListener
Adds the specified listener to receive allITEM
events on each component instance in the Java Virtual Machine when they occur.Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.
- Parameters:
l
- the listener to add- See Also:
-
removeItemListener
Removes the specified listener so it no longer receivesITEM
events when they occur.- Parameters:
l
- the listener to remove- See Also:
-
addTextListener
Adds the specified listener to receive allTEXT
events on each component instance in the Java Virtual Machine when they occur.Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.
- Parameters:
l
- the listener to add- See Also:
-
removeTextListener
Removes the specified listener so it no longer receivesTEXT
events when they occur.- Parameters:
l
- the listener to remove- See Also:
-