Hello everyone,
I've got a class that extends Thread and performs a simple animation by redrawing an oval every fraction of a second. What it actually does is that it sets the circle's color at the previous location to white and then recreates it with its normal color at the new position.
I have tried to add this to a canvas, or any other container for that matter, but to no avail. Note that I am not using the repaint() method.
I've defined a canvas in my main class (which extends Applet) as such:
I'm simply trying to add an object of type Graphics 'g' (from my other class) to the canvas. I've tried myCanvas.add(g), add(myCanvas); but doesn't seem to be working.
Any help would be greatly appreciated.
I've got a class that extends Thread and performs a simple animation by redrawing an oval every fraction of a second. What it actually does is that it sets the circle's color at the previous location to white and then recreates it with its normal color at the new position.
I have tried to add this to a canvas, or any other container for that matter, but to no avail. Note that I am not using the repaint() method.
I've defined a canvas in my main class (which extends Applet) as such:
I'm simply trying to add an object of type Graphics 'g' (from my other class) to the canvas. I've tried myCanvas.add(g), add(myCanvas); but doesn't seem to be working.
Any help would be greatly appreciated.