Adds an AWTEventListener to receive all AWTEvents dispatched system-wide that conform to the given
eventMask
.
First, if there is a security manager, its checkPermission
method is called with an AWTPermission("listenToAllAWTEvents")
permission. This may result in a SecurityException.
eventMask
is a bitmask of event types to receive. It is constructed by bitwise OR-ing together the event masks defined in AWTEvent
.
Note: event listener use is not recommended for normal application use, but are intended solely to support special purpose facilities including support for accessibility, event record/playback, and diagnostic tracing. If listener is null, no exception is thrown and no action is performed.
@param listener the event listener.
@param eventMask the bitmask of event types to receive
@throws SecurityException if a security manager exists and its checkPermission
method doesn't allow the operation.
@see #removeAWTEventListener
@see #getAWTEventListeners
@see SecurityManager#checkPermission
@see java.awt.AWTEvent
@see java.awt.AWTPermission
@see java.awt.event.AWTEventListener
@see java.awt.event.AWTEventListenerProxy
@since 1.2