The actionPerformed Method
Our test applet has three buttons
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" ) {…} … }