Lecture 15 - Events Flashcards
1
Q
Where are events mainly used?
A
Events are mainly used in GUI’s.
2
Q
Mode of delegation
A
There is a source, event and listener. Starts at the source, ends at the listener.
3
Q
Listeners and Sources
A
There can be more than one listener registered to a source, even if it reacts to the same event.
(A button can have 2 listeners where when clicked, one listener plays a music and another takes care of opening a GUI page.) The event is MouseEvent, the source is the MousePointer but there 2 listeners attached to the MousePointer.
4
Q
Class XEvent
A
If there is a class XEvent, there is an interface XListener. If interface contains more than one method, then class XAdapter exists.