Introduction to OOP Chapter 22: The AWT and Swing : next previous audio real text

Adapters Reduce Code Size

More often than not, programmers are interested in only one or two events, not all the possible events defined by the interface.

An adapter provides empty implementations, allowing the programmer to redefine only the events of interest.

public class MouseAdapter implements MouseListener {
	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) { }
}
Intro OOP, Chapter 22, Slide 07