Chapter 11. Handling Mouse and Keyboard Events

Topics in This Chapter

  • The general strategy for event handling

  • Using a separate object to handle events

  • Implementing an interface to handle events

  • Using inner classes to handle events

  • Understanding the standard event listeners

  • Handling events with the processXxxEvent methods

  • A spelling-correcting textfield

  • An interactive whiteboard

Certain user actions are classified as events. These include such actions as clicking a mouse button, typing a key, or moving a window. The interesting thing about event handling in Java is that you never actually check to see if events have occurred. Instead, you simply tell the system “If an event of the following type occurs in this window, tell such and such an object about ...

Get Core Web Programming, Second 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.