Event Handling Question
Something about the AWT event model is puzzling me. Scenario: A button component
has registered an event listener (implementing a MouseAdapter, for instance).
Now, the Listener is implementing, say, two or three methods (mouseClicked,
mouseExit, etc.). When the mouse clicks on the button, or exits the button,
this "Event" is passed to the appropriate method implemented in the Listener
(then handled in some way).
All that is fine and dandy. But my questions...
What is actually generating the original event? I read things like, "The
AWT passes the event to the component(button)." If that is the case, and
the button isn't generating the event object, then what in the AWT is? Also,
once the event object exists, how does the button know which method in the
Listener to call? It's passing (or forwarding the event object) but how
does it know it should pass it to mouseClicked, or mouseExit, etc.?
Any help or explanation is greatly appreciated!
(note: also posted in AWT message board)
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL