1 | First the applet must create a new instance of the class. Note that the class name is used like a type (just like the built-in Java class names). Drawarea drawing = new Drawarea ( ); This executes the constructor, doing the initialization. |
2 | Now the applet can refer to variables in the class (e.g. x) using the dot notation with the instance, drawing: drawing.x = 10; |
3 | and use methods from the class: drawing.paint ( g ); |