import javax.swing.JButton; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class Button extends JButton implements ActionListener { //*1 Button will BE the listener public Button (String label) { setText (label); addActionListener (this); //*2 Add this button as its own listener } public void actionPerformed (ActionEvent e) { //*3 Callback routine System.out.println ("Button was pushed"); //*3 } }