Events, Event Sources, and Event Listeners

ActionListener interface:
 public interface ActionListener
 {
    void actionPerformed(ActionEvent event);
 }

Click here for an example.

Which objects are the event source and the event listener in the ButtonViewer program?

   Answer: The button object is the event source. The listener  object is the event listener.


Why is it legal to assign a ClickListener object to a variable of type ActionListener?

   Answer: The ClickListener class implements the ActionListener interface.