@Exported public class SwingEventMonitor extends AWTEventMonitor
SwingEventMonitor extends AWTEventMonitor by adding a suite of
 listeners conditionally installed on every Swing component instance
 in the Java Virtual Machine.  The events captured by these listeners
 are made available through a unified set of listeners supported by
 SwingEventMonitor.  With this, all the individual events on each of the
 AWT and Swing 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.
 
Because this class extends AWTEventMonitor, it is not
 necessary to use this class and AWTEventMonitor at the same time.
 If you want to monitor both AWT and Swing components, you should
 use just this class.
AWTEventMonitor| Modifier and Type | Field and Description | 
|---|---|
| protected static EventListenerList | listenerListThe master list of all listeners registered by other classes. | 
| protected static com.sun.java.accessibility.util.SwingEventMonitor.SwingEventListener | swingListenerThe actual listener that is installed on the component instances. | 
actionListener, adjustmentListener, awtListener, componentListener, componentWithFocus, containerListener, focusListener, itemListener, keyListener, mouseListener, mouseMotionListener, textListener, windowListener| Constructor and Description | 
|---|
| SwingEventMonitor() | 
| Modifier and Type | Method and Description | 
|---|---|
| static void | addAncestorListener(AncestorListener l)Adds the specified listener to receive all  ANCESTORevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addCaretListener(CaretListener l)Adds the specified listener to receive all  CARETevents
 on each component instance in the Java Virtual Machine as they occur. | 
| static void | addCellEditorListener(CellEditorListener l)Adds the specified listener to receive all
  CELLEDITORevents on each
 component instance in the Java Virtual Machine as they occur. | 
| static void | addChangeListener(ChangeListener l)Adds the specified listener to receive all  CHANGEevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addColumnModelListener(TableColumnModelListener l)Adds the specified listener to receive all  COLUMNMODELevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addDocumentListener(DocumentListener l)Adds the specified listener to receive all  DOCUMENTevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addInternalFrameListener(InternalFrameListener l)Adds the specified listener to receive all  INTERNALFRAMEevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addListDataListener(ListDataListener l)Adds the specified listener to receive all  LISTDATAevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addListSelectionListener(ListSelectionListener l)Adds the specified listener to receive all  LISTSELECTIONevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addMenuListener(MenuListener l)Adds the specified listener to receive all  MENUevents
 on each component instance in the Java Virtual Machine as they occur. | 
| static void | addPopupMenuListener(PopupMenuListener l)Adds the specified listener to receive all  POPUPMENUevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addPropertyChangeListener(PropertyChangeListener l)Adds the specified listener to receive all  PROPERTYCHANGEevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addTableModelListener(TableModelListener l)Adds the specified listener to receive all  TABLEMODELevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addTreeExpansionListener(TreeExpansionListener l)Adds the specified listener to receive all  TREEEXPANSIONevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addTreeModelListener(TreeModelListener l)Adds the specified listener to receive all  TREEMODELevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addTreeSelectionListener(TreeSelectionListener l)Adds the specified listener to receive all  TREESELECTIONevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addUndoableEditListener(UndoableEditListener l)Adds the specified listener to receive all  UNDOABLEEDITevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | addVetoableChangeListener(VetoableChangeListener l)Adds the specified listener to receive all  VETOABLECHANGEevents on each component instance in the Java Virtual Machine as they occur. | 
| static void | removeAncestorListener(AncestorListener l)Removes the specified listener so it no longer receives
  ANCESTORevents when they occur. | 
| static void | removeCaretListener(CaretListener l)Removes the specified listener so it no longer receives
  CARETevents when they occur. | 
| static void | removeCellEditorListener(CellEditorListener l)Removes the specified listener so it no longer receives
  CELLEDITORevents when they occur. | 
| static void | removeChangeListener(ChangeListener l)Removes the specified listener so it no longer receives
  CHANGEevents when they occur. | 
| static void | removeColumnModelListener(TableColumnModelListener l)Removes the specified listener so it no longer receives
  COLUMNMODELevents when they occur. | 
| static void | removeDocumentListener(DocumentListener l)Removes the specified listener so it no longer receives
  DOCUMENTevents when they occur. | 
| static void | removeInternalFrameListener(InternalFrameListener l)Removes the specified listener so it no longer receives
  INTERNALFRAMEevents when they occur. | 
| static void | removeListDataListener(ListDataListener l)Removes the specified listener so it no longer receives
  LISTDATAevents when they occur. | 
| static void | removeListSelectionListener(ListSelectionListener l)Removes the specified listener so it no longer receives
  LISTSELECTIONevents when they occur. | 
| static void | removeMenuListener(MenuListener l)Removes the specified listener so it no longer receives
  MENUevents when they occur. | 
| static void | removePopupMenuListener(PopupMenuListener l)Removes the specified listener so it no longer receives
  POPUPMENUevents when they occur. | 
| static void | removePropertyChangeListener(PropertyChangeListener l)Removes the specified listener so it no longer receives
  PROPERTYCHANGEevents when they occur. | 
| static void | removeTableModelListener(TableModelListener l)Removes the specified listener so it no longer receives
  TABLEMODELevents when they occur. | 
| static void | removeTreeExpansionListener(TreeExpansionListener l)Removes the specified listener so it no longer receives
  TREEEXPANSIONevents when they occur. | 
| static void | removeTreeModelListener(TreeModelListener l)Removes the specified listener so it no longer receives
  TREEMODELevents when they occur. | 
| static void | removeTreeSelectionListener(TreeSelectionListener l)Removes the specified listener so it no longer receives
  TREESELECTIONevents when they occur. | 
| static void | removeUndoableEditListener(UndoableEditListener l)Removes the specified listener so it no longer receives
  UNDOABLEEDITevents when they occur. | 
| static void | removeVetoableChangeListener(VetoableChangeListener l)Removes the specified listener so it no longer receives
  VETOABLECHANGEevents when they occur. | 
addActionListener, addAdjustmentListener, addComponentListener, addContainerListener, addFocusListener, addItemListener, addKeyListener, addMouseListener, addMouseMotionListener, addTextListener, addWindowListener, getComponentWithFocus, removeActionListener, removeAdjustmentListener, removeComponentListener, removeContainerListener, removeFocusListener, removeItemListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeTextListener, removeWindowListenerprotected static final EventListenerList listenerList
protected static final com.sun.java.accessibility.util.SwingEventMonitor.SwingEventListener swingListener
public static void addAncestorListener(AncestorListener l)
ANCESTOR
 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.
l - the listener to addremoveAncestorListener(javax.swing.event.AncestorListener)public static void removeAncestorListener(AncestorListener l)
ANCESTOR events when they occur.l - the listener to removeaddAncestorListener(javax.swing.event.AncestorListener)public static void addCaretListener(CaretListener l)
CARET 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.
l - the listener to addremoveCaretListener(javax.swing.event.CaretListener)public static void removeCaretListener(CaretListener l)
CARET events when they occur.l - the listener to removeaddCaretListener(javax.swing.event.CaretListener)public static void addCellEditorListener(CellEditorListener l)
CELLEDITOR 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.
l - the listener to addremoveCellEditorListener(javax.swing.event.CellEditorListener)public static void removeCellEditorListener(CellEditorListener l)
CELLEDITOR events when they occur.l - the listener to removeaddCellEditorListener(javax.swing.event.CellEditorListener)public static void addChangeListener(ChangeListener l)
CHANGE
 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.
l - the listener to addremoveChangeListener(javax.swing.event.ChangeListener)public static void removeChangeListener(ChangeListener l)
CHANGE events when they occur.l - the listener to removeaddChangeListener(javax.swing.event.ChangeListener)public static void addColumnModelListener(TableColumnModelListener l)
COLUMNMODEL
 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.
l - the listener to addremoveColumnModelListener(javax.swing.event.TableColumnModelListener)public static void removeColumnModelListener(TableColumnModelListener l)
COLUMNMODEL events when they occur.l - the listener to removeaddColumnModelListener(javax.swing.event.TableColumnModelListener)public static void addDocumentListener(DocumentListener l)
DOCUMENT
 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.
l - the listener to addremoveDocumentListener(javax.swing.event.DocumentListener)public static void removeDocumentListener(DocumentListener l)
DOCUMENT events when they occur.l - the listener to removeaddDocumentListener(javax.swing.event.DocumentListener)public static void addListDataListener(ListDataListener l)
LISTDATA
 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.
l - the listener to addremoveListDataListener(javax.swing.event.ListDataListener)public static void removeListDataListener(ListDataListener l)
LISTDATA events when they occur.l - the listener to removeaddListDataListener(javax.swing.event.ListDataListener)public static void addListSelectionListener(ListSelectionListener l)
LISTSELECTION
 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.
l - the listener to addremoveListSelectionListener(javax.swing.event.ListSelectionListener)public static void removeListSelectionListener(ListSelectionListener l)
LISTSELECTION events when they occur.l - the listener to removeaddListSelectionListener(javax.swing.event.ListSelectionListener)public static void addMenuListener(MenuListener l)
MENU 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.
l - the listener to addremoveMenuListener(javax.swing.event.MenuListener)public static void removeMenuListener(MenuListener l)
MENU events when they occur.l - the listener to removeaddMenuListener(javax.swing.event.MenuListener)public static void addPopupMenuListener(PopupMenuListener l)
POPUPMENU
 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.
l - the listener to addremovePopupMenuListener(javax.swing.event.PopupMenuListener)public static void removePopupMenuListener(PopupMenuListener l)
POPUPMENU events when they occur.l - the listener to removeaddPopupMenuListener(javax.swing.event.PopupMenuListener)public static void addTableModelListener(TableModelListener l)
TABLEMODEL
 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.
l - the listener to addremoveTableModelListener(javax.swing.event.TableModelListener)public static void removeTableModelListener(TableModelListener l)
TABLEMODEL events when they occur.l - the listener to removeaddTableModelListener(javax.swing.event.TableModelListener)public static void addTreeExpansionListener(TreeExpansionListener l)
TREEEXPANSION
 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.
l - the listener to addremoveTreeExpansionListener(javax.swing.event.TreeExpansionListener)public static void removeTreeExpansionListener(TreeExpansionListener l)
TREEEXPANSION events when they occur.l - the listener to removeaddTreeExpansionListener(javax.swing.event.TreeExpansionListener)public static void addTreeModelListener(TreeModelListener l)
TREEMODEL
 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.
l - the listener to addremoveTreeModelListener(javax.swing.event.TreeModelListener)public static void removeTreeModelListener(TreeModelListener l)
TREEMODEL events when they occur.l - the listener to removeaddTreeModelListener(javax.swing.event.TreeModelListener)public static void addTreeSelectionListener(TreeSelectionListener l)
TREESELECTION
 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.
l - the listener to addremoveTreeSelectionListener(javax.swing.event.TreeSelectionListener)public static void removeTreeSelectionListener(TreeSelectionListener l)
TREESELECTION events when they occur.l - the listener to removeaddTreeSelectionListener(javax.swing.event.TreeSelectionListener)public static void addUndoableEditListener(UndoableEditListener l)
UNDOABLEEDIT
 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.
l - the listener to addremoveUndoableEditListener(javax.swing.event.UndoableEditListener)public static void removeUndoableEditListener(UndoableEditListener l)
UNDOABLEEDIT events when they occur.l - the listener to removeaddUndoableEditListener(javax.swing.event.UndoableEditListener)public static void addInternalFrameListener(InternalFrameListener l)
INTERNALFRAME
 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.
l - the listener to addremoveInternalFrameListener(javax.swing.event.InternalFrameListener)public static void removeInternalFrameListener(InternalFrameListener l)
INTERNALFRAME events when they occur.l - the listener to removeaddInternalFrameListener(javax.swing.event.InternalFrameListener)public static void addPropertyChangeListener(PropertyChangeListener l)
PROPERTYCHANGE
 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.
l - the listener to addremovePropertyChangeListener(java.beans.PropertyChangeListener)public static void removePropertyChangeListener(PropertyChangeListener l)
PROPERTYCHANGE events when they occur.l - the listener to removeaddPropertyChangeListener(java.beans.PropertyChangeListener)public static void addVetoableChangeListener(VetoableChangeListener l)
VETOABLECHANGE
 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.
l - the listener to addremoveVetoableChangeListener(java.beans.VetoableChangeListener)public static void removeVetoableChangeListener(VetoableChangeListener l)
VETOABLECHANGE events when they occur.l - the listener to removeaddVetoableChangeListener(java.beans.VetoableChangeListener)
 Copyright © 2002, 2025, Oracle and/or its affiliates.  All rights reserved.