Events Flashcards

1
Q

What model is the Java event system based on? Explain the model…

A

Delegation Model.
Event sources cause an event via changing some state within the program. An event listener then reacts as specified.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the 2 ways events are implemented?

A

Polling : Waiting for an indefinite amount of time in a loop for an event to occur via some condition.
Event driven : Create idle code that only executes when a certain event occurs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the 3 components of the events framework?

A

Events : Change of state within the program.
Event Source : An object that generates a state change.
Event Listener : An object that responds to the event in a defined way.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where do all event sources descend from?

A

Event Object class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where do all event listeners descent from?

A

Event Listener interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly