Why can't the whole program just consist of the one line that does the painting ?
In Java, to create an applet, you can't call on functions without defining a class to call them.
To appear on the web, Java must use an applet, and without first defining a class, you won't be painting onto anything.
The drawString function is not defined without the "import" statements at the top.
All of the above.