1 | Our test applet has three buttons |
2 | The actionPerformed(...) method determines which button was pressed : public void actionPerformed(ActionEvent e) { String label = e.getActionCommand(); if ( label.equals( "Red" ) {...} else if ( label.equals( "White" ) {...} else if ( label.equals( "Blue" ) {...} ... } |