Hour 15. Responding to User Input

What You’ll Learn in This Hour:

• Making your programs aware of events

• Setting up a component so it can cause events

• Ignoring some components

• Finding out where events end up in a program

• Storing information in the interface

• Converting values stored in text fields

The graphical user interface (GUI) you developed during the past two hours can run on its own. Users can click buttons, fill text fields with text, and resize the window. Sooner or later, even the least discriminating user is going to be left wanting more. The GUI that a program offers has to cause things to happen when a mouse-click or keyboard entry occurs.

These things become possible when your Java program can respond to user events, which ...

Get Sams Teach Yourself Java™ in 24 Hours, Sixth 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.