if (e.getSource() == b1) showStatus("Thanks for pushing my first button!"); else showStatus("Thanks for pushing my second button!");
add(b1 = new Button("A button")); b1.addActionListener(this); add(b2 = new Button("Another button")); b2.addActionListener(this);