Also see:

http://www.javaprogrammingforums.com/java-code-snippets-tutorials/278-how-add-actionlistener-jbutton-java-swing.html