The main applet class extends Applet and contains the buttons and
the MyPanel, and is registered as an ActionListener for the button
events, it implements ActionListener.
When it receives button events,
it just forwards those events to MyPanel by invoking MyPanel's
changeColor()
method.
This method changes the color of the square and requests a repaint of
the panel.