Hi,
I'm building a small drawing application in Swing. I'm using JComponent as the drawing board,
I capture the drawing on the JComponent using the following code:


RepaintManager manager = RepaintManager.currentManager(drawBoard);
drawing = manager.getOffscreenBuffer(drawBoard, drawBoard.getWidth(), drawBoard.getHeight());




and I use the following code for redrawing the image on the JComponent


getGraphics().drawImage(drawing,0,0,drawBoard.getWidth(), drawBoard.getHeight(),drawBoard);




What happens when redrawing is that I get other parts on the GUI redrawn on the drawing board!
Any one can tell me what am I doing wrong? should I try something else?

Thanks in advance,
Ayman