Defining another class
In the same file as the applet, you can define another class.
It should have variables, a constructor method of the same name, and any other methods, such as paint.
class Drawarea extends Canvas
{ //declare variables here
// this method is the constructor
// do initialization stuff here
public void paint ( Graphics g )
// call drawing methods here