21163 - VictoriaBrown/MyProgrammingLab_Ch10 GitHub Wiki

QUESTION:

In order to respond to the click of a button, an object must be capable of being notified when the button was clicked. This is achieved by the Button object requiring that any such 'listener' provide a method named actionPerformed which can then be called to notify the listening object . Define an interface, ActionListener, with a single void-returning method , actionPerformed that accepts a single parameter of type ActionEvent.

CODE:

public interface ActionListener {

	// actionPerformed method:
	void actionPerformed(ActionEvent a);

}