* Definition: http://journals.ecs.soton.ac.uk/java/tutorial/post1.0/ui/actionlistener.html ** Simple Example: http://journals.ecs.soton.ac.uk/java/tutorial/post1.0/ui/eventintro.html#example1 ''This example emphasizes an event registration, but forgets event unregistration, therefore possibly leading to a MemoryLeak. This is the typical kind of code that teaches very bad habits to developers.'' ---- * Api: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/event/ActionListener.html ---- An ActionListener is a sub-interface of EventListener * It allows an EventSource to know about all Listeners which want to be informed When a user * clicks a button * doubleclicks a list item * chooses a menu item * presses return in a text field example '' button.addActionListener(this);'' ---- ActionListener''''''s in JavaSwing implement the ActionListener interface with an ActionListener.actionPerformed(ActionEvent e) method defined which is called when an event (clicking a button, etc) takes place. They sort-of represent the controller in ModelViewController. -- BrianMcCallister ''In what way would you say they differ from the MVC controller?'' ---- Listeners are MethodObject''''''s. ''They don't have to be.''