Section 12.15 Adapter Classes

• An adapter class (p. 518) implements an interface and provides default implementations of its methods. When you extend an adapter class, you can override just the method(s) you need.

MouseEvent method getClickCount (p. 521) returns the number of consecutive mouse-button clicks. Methods isMetaDown (p. 528) and isAltDown (p. 521) determine which button was clicked.

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.