Need Help with Paint Proccess

Need help with a java project. My java application draws animated 2D objects in a canvas using BufferStrategy. Upon certain events I want to open another Frame; Frame A opens Frame B and draw objects into Frame B from Frame A's paint process. Not sure what I am doing wrong but it will not display what was drawn in Frame B unless I set focus to Frame B. I need to paint to Frame B and have it shown without changing focus to it.

Example;

// MyCanvasClass - Used for Frame A and Frame B

publicvoid paint(Graphics g){

if (this.frame == FrameB)

this.requestFocus();

if ( bimg ==null){

createBufferStrategy(2);

bimg = getBufferStrategy();

g2 = (Graphics2D)bimg.getDrawGraphics();

clearcanvas =true;

}else

g2 = (Graphics2D)bimg.getDrawGraphics();

render(g2);

bimg.show();

if ( clearcanvas){

clearcanvas =false;

}

toolkit.sync();

// If Primary Frame and Frame B has been drawn too, repaint it.

if (this.frame != FrameB && FrameB.dirty ==true){

FrameB.canvas.repaint();

FrameB.dirty =false;

}

}

publicvoid update(Graphics g){

if (this.frame == FrameB)

this.requestFocus();

if (clearcanvas){

super.update(g);

}else{

if ( bimg ==null){

createBufferStrategy(2);

bimg = getBufferStrategy();

g2 = (Graphics2D)bimg.getDrawGraphics();

clearcanvas =true;

}else

g2 = (Graphics2D)bimg.getDrawGraphics();

Myupdate(g2);

toolkit.sync();

// If Primary Frame and Frame B has been drawn too, repaint it.

if (this.frame != FrameB && FrameB.dirty ==true){

FrameB.canvas.repaint();

FrameB.dirty =false;

}

}

}

Thanks for any help you can provide!

Dave

[3213 byte] By [DCook_CCSAa] at [2007-10-2 12:58:25]
# 1
Thought I would post how I resoved this problem. It was simple, when I was done with the paint process for Frame A that also draws to Frame B, just simple do a BufferStrategy.show() on the Frame B BufferStrategy.
DCook_CCSAa at 2007-7-13 10:16:32 > top of Java-index,Java Essentials,Java Programming...