Similarly, the Component
class provides
view classes with the following:
addMouseListener
, that connect listeners to view
instances
mouseClicked
to activate listeners
Listener interfaces insist that you define various essential methods:
mouseClicked
, are called by inherited machinery
whenever an event occurs.
Listener methods do whatever you tell them to do. Typically, listener methods fetch values from views and relay those values to models.