Action Listeners! Swing is actually not bad with Netbeans doing the heavy lifting.