Answer:

Yes. A "listener object" is an object that has listener methods, but it may have other methods.

Event Object

Event Object sent from button to listener

An event listener is an object that "listens" for events from a GUI component, like a button. An event is represented as an object. When the user generates an event, the system creates an event object, which is then sent to the listener that has been registered for the GUI component.

When an event is generated by the GUI component, a method in the listener object is invoked. To be able to respond to events, a program must first:

  1. Create an event listener object for the type of event.
  2. Register the listener object with the GUI component that generates the event (or with a component that contains it).

In the picture, the component is the button, contained in a frame. The user event is a click on that button. An Event object is sent to the registered listener. This is done by the Java system, which manages the GUI components. It is up to the listener to do something.

QUESTION 11:

(Thought Question: ) Does the Java system create an Event object every time the user interacts with a component?