Introduction to OOP | Chapter 22: The AWT and Swing : | next | previous | audio | real | text |
Every component (window, button, scroll bar) maintains a list of ``listeners''; objects that are interested in being notified when an event has taken place.
Each type of event is defined by an interface, such as the following:
public interface MouseListener extends EventListener { public void mouseClicked (MouseEvent e); public void mouseEntered (MouseEvent e); public void mouseExited (MouseEvent e); public void mousePressed (MouseEvent e); public void mouseReleased (MouseEvent e); }