Back to category: Technology

Limited version - please login or register to view the entire paper.

Event handlers

Event Handlers


What is an event?

event /vent/ noun
“a thing that happens, especially important”

“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. “

The above definition can be found at the java.sun.com web site, it is concise but not very clear in helping to understand in layman’s terms what exactly is represented by an “event”. A better analogy to the various parts of an event, as intended in Java with sources, listeners etc, could be represented, maybe, by a mother and her child at the park. As a parallelism to Java we can consider the child and mother as two “components”. The sandbox where the child is playing as a “panel” that contains the child and the bench where the mother is reading a as another “panel”. And, finally, the park as the “fr...

Posted by: Sylvia Schiavoni

Limited version - please login or register to view the entire paper.