Chapter 15. Responding to User Input

<feature><title></title>

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

</feature>

The graphical user interface (GUI) you developed during the past two hours can run on its own. Buttons can be clicked, text fields filled with text, and the window can be resized. 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 ...

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