Chapter 13. Responding to User Input in an Applet

With the skills you have developed so far, you can design a graphical user interface with beauty but no brains. It might look like a working interface—receiving button clicks and other interactions like any other program—but nothing happens in response to those interactions.

To make an interface functional in Java, you must learn how to make a program respond to events. Events are method calls that Java's windowing system performs whenever any element of a user interface is manipulated. A wide variety of events cover mouse and keyboard use, including mouse-click events, mouse-movement events, and keypress events.

Today you learn how to make an applet handle events by using the techniques of Java ...

Get Sams Teach Yourself Java™ 2 Platform in 21 Days Professional Reference 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.