Chapter 15. Responding to User Input



  • 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. 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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.