title: How to detect when a JButton is pressed (swing)?
body: <p>In Java's swing package, I was wondering how to detect when a JButton is pressed.  Is there a function that is called when the button is pressed?  Thanks</p>