The event generator (button, for example) and the event listener (listens to the button to determine when it is clicked) must know about each other to establish a relationship. Therefore for each event-generating component, if we want something to happen when an event is generated, we have to add a listener that listens specifically for that event. Each event-generating component has methods that are used to register listeners.
The object that is selected to be the listener must belong to a class that implements the listener interface, and as a result implements the required interface methods.