Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chapter 3 Event Handling - Coggle Diagram
Chapter 3 Event Handling
Events
-
example : clicking on a button, moving the mouse, and entering a character through keyboard
-
Types Of Event
Foreground Events
require direct interaction of the user. They are generated as consequences of a person interacting with the GUI components
example : clicking on a button, moving the mouse, entering a character through keyboard
Background Events
-
example : timer expires,
counter exceeds a value,
software or hardware failure occurs
-
Event Handler Required
3 pieces of code
First, in the declaration of the event handler class, one line of code must specify that the class implements a listener interface.
-
Second, registers an instance of the event handler class as a listener of the components.
-
Third, the event handler must have a piece of code that implements the methods in the listener interface.
-