GUI programs are event-driver . That is, user actions such as clicking on a button or pressing a key on the keyboard generate events, and the program must respond to these events as they occur. Event-driven programming builds on all the skills you have learned in the first five chapters of this text. You need to be able to write the subroutines that respond to events. And of course, objects are everywhere.
Events are objects.
Applets and other GUI components are objects. Events are handled by instance methods contained in objects. This chapter covers the basics of applets, graphics, components, and events. The discussion of applets and GUI's will continue in the next chapter with more details and with more advanced techniques.