Listener : Java Glossary


If an object is interested in hearing about events generated in some component, it may register itself as a listener for that type of event. If your component uses an anonymous inner class that extends one of the eventListenerAdapter classes, it can register itself as a listener for any class of event. This won’t interfere with subclasses doing the same thing. Everybody gets notified. event.consume() is the way a subclass can suppress a superclass seeing the event too.

addXXXListener is not smart enough to avoid adding a listerner twice if it is already added. removeXXXListener is not smart enough to remove all copies of this component if it has been inadvertently added more than once. If your component keeps listening after the remove, check the list of listeners for duplicates with getXXXListeners.

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number