image

CHAPTER

2

Introducing Events and Controls

The program shown at the end of the previous chapter presented a simple example that constructed a scene graph and introduced the Label control. However, it did not show one important feature found in most JavaFX programs: event handling. In JavaFX, an event is an object that describes some action that has affected the program, such as when the user interacts with the program by clicking a button. Because Label does not take input from the user, it does not generate events, so no event handling was needed to use it. However, other JavaFX controls do generate events in response to user input. For example, ...

Get Introducing JavaFX 8 Programming 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.