3.1 Delegation Event Model
3.1 Delegation Event Model
Unit Outcome-
1. Use delegation event model to develop event driven program for the given
problem
2. Use relevant AWT/Swing components to handle the given event
3. Use adapter classes in java program to solve the given problem
4. Use inner classes in java program to solve the given probelm
Delegation event model
- the delegation event model is based on the Event Source and Event Listeners.
-Changing the state of an object is known as an event.
-For Example : Pressing a button, Entering a character in Textbox, Clicking or Dragging
a mouse, etc.
Methods-
1. int getID( )-determine the type of the event.
2. Object getSource( )- returns the source of the event.
Event Classes Description Listener Interface
ActionEvent generated when button is pressed, menu-item is selected, list- ActionListener
item is double clicked
MouseEvent generated when mouse is dragged, moved,clicked,pressed or MouseListener
released and also when it enters or exit a component