Event Handling In Java - A Quick Recap (
Page 7 of 7 )
A quick recap: Every time the
user types a character or pushes a mouse button, an event occurs. Any object can
be notified of the event. All it has to do is implement the appropriate
interface and be registered as an event listener on the appropriate event
source. Swing components can generate many kinds of events.
Each event
is represented by an object that gives information about the event and
identifies the event source. Event sources are typically components, but other
kinds of objects can also be event sources. Each event source can have multiple
listeners registered on it. Conversely, a single listener can register with
multiple event sources.
In the next part of the tutorial we will see
about Explicit Event-handling and adapters.