This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Its common to use an inner class when adding an ActionEvent to a listener, for example in Swing. This removes the need to conditionally test what button has been clicked in a function to designate the appropriate action: A quick sketch example would be....
The inner class would then extend the relevant abstract classes for action-Events and the overridden method ActionPerformed() will handle the button click. Take a look also on the Swing Forums here at the ranch.
be a well encapsulated person, don't expose your privates, unless you public void getWife()!