i have used AWT for constructing a ImageDrawing tool,for that i used a canvas as the drawing pad.in my tool box i have options such as Line,Circle,Rectangle,Freeline etc.the method which i am using is as follows 1.i record all the points in which line or circle is drawn 2. all the points are recorded in a Vector 3.every time i finished drawing something i redraw all the points that ihave recorded earlier Now the problem is ------------------ after a lot of drawing the canvas flickers which unables me to see what i am drawing,i used update() in the code,but it shows me another problem,when ever i draw a colorline or something else it shows me a number of lines,after minimize if i maximaize the scren it shows the correct image ie what i have drawn,removing all other lines
Manu, It sounds like you are having refresh problems.... you need to override update() ( if you have not already, you mentioned something about using update in your post. ), and use double buffering. Double buffering is an offscreen image that you draw to and then send to the screen all at once, so the user will not see the redraws. Here is an example of how you would do it.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: Mar 18, 2001
thank u for ur reply it did work very well,hoping 2 get ur help more