When a normal Java program (which is not GUI-based) needs input, it prompts the user and then calls some input method, such as reading() i.e. the interaction is initiated by the program. This is not the way in which GUI-based programs behave. The user initiates interaction with the program rather than the program initiating the action.
1. Welcome to
Ducat
India
Language | Industrial Training | Digital Marketing | Web Technology |
Testing+ | Database | Networking | Mobile Application | ERP | Graphic
| Big Data | Cloud Computing
Call us:
70-70-90-50-90
www.ducatindia.com
JAVA
Sessions
2. Java AWT EVENTS
Introduction
When a normal Java program (which is not GUI-based) needs input, it prompts the user and then calls some
input method, such as reading() i.e. the interaction is initiated by the program. This is not the way in which
GUI-based programs behave. The user initiates interaction with the program rather than the program
initiating the action.
For example, in a word processing software, the user initiates action by clicking on different buttons, which
generates an event, and some piece of code is executed as a result and accordingly, some action takes
place. Clicking on the save button will invoke the method which saves the contents to a file.
3. 3
Java uses the event delegation model for event handling. In the event delegation model, a component may
be told which object or should be notified when the component generates a particular kind of event.
If a component is not interested in an event type, then events of that type will not be propagated. The
delegation model is based on the following key concepts:
• Event classes.
• Event listeners.
• Adapters.
…Read More https://tutorials.ducatindia.com/java/java-awt-events/