In the javadoc it says that EventListener is
"A tagging interface that all event listener interfaces must extend."
Why is that? What's the significance of making a custom listener implement EventListner? Is there any special handling for EventListner somewhere?
java. util. EventListener is a marker interface(an interface without any methods) that all listeners should implement. In fact, it does not even add any functionality but it may be helpful with some IDEs and code-analysis tools.
An event listener in Java is designed to process some kind of event — it "listens" for an event, such as a user's mouse click or a key press, and then it responds accordingly. An event listener must be connected to an event object that defines the event.
An EventListener interface defines the methods that must be implemented by an event handler for a particular kind of an event whereas an Event Adapter class provides a default implementation of an EventListener interface.
Probably used by javabeans introspection.
For instance Netbeans beaninfo editor does not recognise the event if extends EventListener
is missing from the Listener.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With