Chapter 8
Events
Objectives:
After completing the chapter, you can:
- get a taste of event-driven programming;
- describe events, event sources, and event classes;
- define handler classes, register handler objects with the source object, and write the code to handle events;
- define handler classes using inner classes;
- define handler classes using anonymous inner classes;
- simplify event handling using lambda expressions;
- use convenience methods;
- understand the structure and operation of a bigger program.
Topics
- 8.1 Introduction
- 8.2 First event handler
- 8.3 Inner classes
- 8.4 Anonymous inner class handlers
- 8.5 Simplifying event handling using lambda expressions
- 8.6 Example program
- 8.7 Tic-tac-toe
- 8.8 Tasks
Alternative materials
- in English: H. Schildt. Java - The Complete Reference: Chapter: 34
- in Estonian: here
- in Russian: Г. Шилдт. Java 8. Полное руководство: Chapter: 34