Computer Science Canada

Drawing with Frame without using repaint()

Author:  Pickles [ Mon May 02, 2005 8:30 pm ]
Post subject:  Drawing with Frame without using repaint()

Is there a way to draw, on the frame without having to call repaint();

Like say I wanted to draw a rectangle when i clicked the mouse, is there away to do that without having the drawRectangle in the paint method, then giving it the right x&y coordinates when clicking? So I could just draw the rectangle without having to redraw the whole screen.

And then if in my paint method I have say g.drawRect(x,y,20,20), and I want to draw a rectangle each time I click, is there a way to do it without making x and y an array in order to keep the old square on the screen?

I think thats about it, i looked through some other threads but couldnt see anything like this, I appologize if I'm blind.


: