I have an idea of how to use action listeners and implementing them but I was wondering if anyone could tell me how do they listen to the events? Is there some kind of poll
The tutorial explains how they work fairly well: http://download.oracle.com/javase/tutorial/uiswing/events/actionlistener.html
I think the UI implementation of the JComponent
will fire (call) all registered events upon the user interacting with it (I think).
For example, when a user clicks a JButton
, the button (or it's ui, or some other internal handler) will lookup all registered ActionListeners
and call their actionPerformed(...)
methods.