Hello Charlotte,
In the code you have quoted look closely:
The line
frame.getContentPane().add(applet)
Adds the applet to the frame.
You can add an applet to a frame, but not the other way round.
Have a look at Suns
Java Tutorial, especially the Swing/AWT trails. They should hopefully clear things up
Hope that helps
Mark