I am making my first learning steps with CN1 graphics.
I encounter difficulties when calling the paint method of the following class in the start () method.
public class DrawingCanvas extends Component {
public void myMethod(Graphics g) {
// some code
}
}
In the start() method, I call the method like this:
public void start() {
DrawingCanvas drawingCanvas = new DrawingCanvas();
drawingCanvas.myMethod(g);
}
The error message I get is : Cannot find symbol : variable g
In my understanding, I now have to define g somehow.
How do I do that?
Graphics g =