What is delegation event model in Java?
The delegation event model defines standard and consistent mechanisms to generate and process events. Its concept is quite simple: a source generates an event and sends it to one or more listeners.
Event Handling in Java
An event can be defined as changing the state of an object or behavior by performing actions. Actions can be a button click, cursor movement, keypress through keyboard or page scrolling, etc.
The java.awt.event package can be used to provide various event classes.
Classification of Events
Foreground Events
Background Events
Sources of Events
EventListner interface
It is a marker interface which every listener interface has to extend.This class is defined in java.util package.
What Is An Adapter-Class?
In JAVA, an adapter class allows the default implementation of listener interfaces. The notion of listener interfaces stems from the Delegation Event Model. It is one of the many techniques used to handle events in Graphical User Interface (GUI) programming languages, such as JAVA.
AWT Label Class
Label is a passive control because it does not create any event when accessed by the user. The label control is an object of Label. A label displays a single line of read-only text.
Button class
Button class is used to create a push button control, which can generate an ActionEvent when it is clicked. In order to handle a button click event, ActionListener interface should be implemented.
What is AWT TextField Java?
The object of a TextField class is a text component that allows a user to enter a single line text and edit it.
Post a Comment
0 Comments