Class SwingEventMonitor
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final EventListenerListThe master list of all listeners registered by other classes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdds the specified listener to receive allANCESTORevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allCARETevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allCELLEDITORevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allCHANGEevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allCOLUMNMODELevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allDOCUMENTevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allINTERNALFRAMEevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allLISTDATAevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allLISTSELECTIONevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allMENUevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allPOPUPMENUevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allPROPERTYCHANGEevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allTABLEMODELevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allTREEEXPANSIONevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allTREEMODELevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allTREESELECTIONevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allUNDOABLEEDITevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allVETOABLECHANGEevents on each component instance in the Java Virtual Machine as they occur.static voidRemoves the specified listener so it no longer receivesANCESTORevents when they occur.static voidRemoves the specified listener so it no longer receivesCARETevents when they occur.static voidRemoves the specified listener so it no longer receivesCELLEDITORevents when they occur.static voidRemoves the specified listener so it no longer receivesCHANGEevents when they occur.static voidRemoves the specified listener so it no longer receivesCOLUMNMODELevents when they occur.static voidRemoves the specified listener so it no longer receivesDOCUMENTevents when they occur.static voidRemoves the specified listener so it no longer receivesINTERNALFRAMEevents when they occur.static voidRemoves the specified listener so it no longer receivesLISTDATAevents when they occur.static voidRemoves the specified listener so it no longer receivesLISTSELECTIONevents when they occur.static voidRemoves the specified listener so it no longer receivesMENUevents when they occur.static voidRemoves the specified listener so it no longer receivesPOPUPMENUevents when they occur.static voidRemoves the specified listener so it no longer receivesPROPERTYCHANGEevents when they occur.static voidRemoves the specified listener so it no longer receivesTABLEMODELevents when they occur.static voidRemoves the specified listener so it no longer receivesTREEEXPANSIONevents when they occur.static voidRemoves the specified listener so it no longer receivesTREEMODELevents when they occur.static voidRemoves the specified listener so it no longer receivesTREESELECTIONevents when they occur.static voidRemoves the specified listener so it no longer receivesUNDOABLEEDITevents when they occur.static voidRemoves the specified listener so it no longer receivesVETOABLECHANGEevents when they occur.Methods declared in class AWTEventMonitor
addActionListener, addAdjustmentListener, addComponentListener, addContainerListener, addFocusListener, addItemListener, addKeyListener, addMouseListener, addMouseMotionListener, addTextListener, addWindowListener, getComponentWithFocus, removeActionListener, removeAdjustmentListener, removeComponentListener, removeContainerListener, removeFocusListener, removeItemListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeTextListener, removeWindowListenerModifier and TypeMethodDescriptionstatic voidAdds the specified listener to receive allACTIONevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allADJUSTMENTevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allCOMPONENTevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allCONTAINERevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allFOCUSevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allITEMevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allKEYevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allMOUSEevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive all mouseMOTIONevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allTEXTevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allWINDOWevents on each component instance in the Java Virtual Machine when they occur.static ComponentReturns the component that currently has keyboard focus.static voidRemoves the specified listener so it no longer receivesACTIONevents when they occur.static voidRemoves the specified listener so it no longer receivesADJUSTMENTevents when they occur.static voidRemoves the specified listener so it no longer receivesCOMPONENTevents when they occur.static voidRemoves the specified listener so it no longer receivesCONTAINERevents when they occur.static voidRemoves the specified listener so it no longer receivesFOCUSevents when they occur.static voidRemoves the specified listener so it no longer receivesITEMevents when they occur.static voidRemoves the specified listener so it no longer receivesKEYevents when they occur.static voidRemoves the specified listener so it no longer receivesMOUSEevents when they occur.static voidRemoves the specified listener so it no longer receivesMOTIONevents when they occur.static voidRemoves the specified listener so it no longer receivesTEXTevents when they occur.static voidRemoves the specified listener so it no longer receivesWINDOWevents when they occur.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Field Details
-
listenerList
The master list of all listeners registered by other classes. This can only be publicly modified by calling the add or remove listener methods in this class.
-
-
Constructor Details
-
SwingEventMonitor
public SwingEventMonitor()Constructs aSwingEventMonitor.
-
-
Method Details
-
addAncestorListener
Adds the specified listener to receive allANCESTORevents 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:
-
removeAncestorListener
Removes the specified listener so it no longer receivesANCESTORevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addCaretListener
Adds the specified listener to receive allCARETevents 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:
-
removeCaretListener
Removes the specified listener so it no longer receivesCARETevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addCellEditorListener
Adds the specified listener to receive allCELLEDITORevents 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:
-
removeCellEditorListener
Removes the specified listener so it no longer receivesCELLEDITORevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addChangeListener
Adds the specified listener to receive allCHANGEevents 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:
-
removeChangeListener
Removes the specified listener so it no longer receivesCHANGEevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addColumnModelListener
Adds the specified listener to receive allCOLUMNMODELevents 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:
-
removeColumnModelListener
Removes the specified listener so it no longer receivesCOLUMNMODELevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addDocumentListener
Adds the specified listener to receive allDOCUMENTevents 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:
-
removeDocumentListener
Removes the specified listener so it no longer receivesDOCUMENTevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addListDataListener
Adds the specified listener to receive allLISTDATAevents 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:
-
removeListDataListener
Removes the specified listener so it no longer receivesLISTDATAevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addListSelectionListener
Adds the specified listener to receive allLISTSELECTIONevents 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:
-
removeListSelectionListener
Removes the specified listener so it no longer receivesLISTSELECTIONevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addMenuListener
Adds the specified listener to receive allMENUevents 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:
-
removeMenuListener
Removes the specified listener so it no longer receivesMENUevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addPopupMenuListener
Adds the specified listener to receive allPOPUPMENUevents 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:
-
removePopupMenuListener
Removes the specified listener so it no longer receivesPOPUPMENUevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addTableModelListener
Adds the specified listener to receive allTABLEMODELevents 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:
-
removeTableModelListener
Removes the specified listener so it no longer receivesTABLEMODELevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addTreeExpansionListener
Adds the specified listener to receive allTREEEXPANSIONevents 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:
-
removeTreeExpansionListener
Removes the specified listener so it no longer receivesTREEEXPANSIONevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addTreeModelListener
Adds the specified listener to receive allTREEMODELevents 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:
-
removeTreeModelListener
Removes the specified listener so it no longer receivesTREEMODELevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addTreeSelectionListener
Adds the specified listener to receive allTREESELECTIONevents 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:
-
removeTreeSelectionListener
Removes the specified listener so it no longer receivesTREESELECTIONevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addUndoableEditListener
Adds the specified listener to receive allUNDOABLEEDITevents 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:
-
removeUndoableEditListener
Removes the specified listener so it no longer receivesUNDOABLEEDITevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addInternalFrameListener
Adds the specified listener to receive allINTERNALFRAMEevents 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:
-
removeInternalFrameListener
Removes the specified listener so it no longer receivesINTERNALFRAMEevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addPropertyChangeListener
Adds the specified listener to receive allPROPERTYCHANGEevents 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:
-
removePropertyChangeListener
Removes the specified listener so it no longer receivesPROPERTYCHANGEevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addVetoableChangeListener
Adds the specified listener to receive allVETOABLECHANGEevents 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:
-
removeVetoableChangeListener
Removes the specified listener so it no longer receivesVETOABLECHANGEevents when they occur.- Parameters:
l- the listener to remove- See Also:
-