Event Handling

Опубликовано: 13 Апрель 2020
на канале: Soumyashree Sahoo
35
0

GUI applications are event-driven. An application reacts to different event types which are generated during its lifetime. Events are generated by a user (a mouse click), an application (a timer), or the system (a clock).

An event is a notification about a change. It encapsulates the state changes in the event source. Registered event filters and event handlers within the application receive the event and provide a response.

Every event in JavaFX has three properties:

Event source
Event target
Event type
Event source is the object whose state changes; it generates events. Event target is the destination of the an event. Event type provides additional classification to events of the same Event class.

In the video you will see two events(Setonaction & SetOnMousePressed) applied to Exit menuitem and TextArea.