package class4_2_ActionHandlers; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class ButtonHandler implements ActionListener { private Gui gui; public ButtonHandler(Gui gui) { this.gui = gui; } /** * Make the label say "start" if I press start, * and "stop" if I press stop. * @param e the event that occurred */ public void actionPerformed(ActionEvent e) { System.out.println("Button pressed"); String command = e.getActionCommand(); System.out.println("Action: "+command); } }