8.5 Graphics Supplement
Good Heavens! For more than forty years I have been speaking prose without knowing it.
—MOLIèRE, Le Bourgeois Gentilhomme
Event-Driven Programming
In this section, we explain how to assign actions to a control like a button. JavaFX applications use events and event handlers. An event is an object that represents some user action that elicits a response, such as clicking a button with the mouse. When an object generates an event, it is said to fire the event. For example, when the user clicks a button, the button fires an event. In a JavaFX application, every object that can fire events can have one or more listener objects that receive events automatically. A listener object has methods that specify what will happen ...
Get Java: An Introduction to Problem Solving and Programming, 8th 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.