The application of Figs. 12.31–12.32 demonstrates how to determine the number of mouse clicks (i.e., the click count) and how to distinguish between the different mouse buttons. The event listener in this application is an object of inner class
MouseClickHandler (Fig. 12.31, lines 25–46) that extends
MouseAdapter, so we can declare just the
mouseClicked method we need in this example.