I'm having problem when drawing on the applet. I'm using an image for drawing, means using image of the size of the applet for drawing. When I draw anything at the image, if I do the drawing in paint method then it works else not. Don't know whats the problem with it. Reply soon Thankx in advance
I was under the (perhaps incorrect) impression that painting only can be done in the paintmethod. So painting should only be done there. If you call a method during execution of the paintmethod and do some painting in that method, that will be fine, too! /Kaspar
The reason you are having this problem is because of the repaint() -> update() -> paint() cycle that happens when the applet is repainted. The only thing that the applet 'remembers' to paint when the screen is refreshed is code in these methods, or code in methods called by these... a good rule of thumb is to keep all your painting code in the paint() method, or methods that are called by the paint method... anything else ( such as painting done in event handlers ) disappears when the screen is refreshed.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.