Problem with Java Applet - background not refreshed on browser maximization

Hello I have a code that creates a Java applet by extending JApplet.

This code draws some graphics in paint().

The problem is:

when the browser is minimized, and then maximized, the applet rectangular area shows an image which is the content of the window that became focused when the browser was minimized.

Does anyone have an idea about what could be causing this problem?

Thanks.

[419 byte] By [ZeroOneZeroOneOnea] at [2007-11-27 10:18:16]
# 1

Possibly need to do something like

container.addComponentListener( new ComponentAdapter(){

public void componentResized(ComponentEvent e){

// rescale();

}

});

GeoffTitmussa at 2007-7-28 15:56:30 > top of Java-index,Desktop,Core GUI APIs...
# 2

Hello, some more info:

Adding this code to the first lines of the new paint() method:

super.paint ( g );

repaint ( 0 );

This was found online and kind of fixes the problem but it makes the applet refresh a lot.

Is there any other fix for this problem?

If the problem is not clear I can put screenshots online.

Thanks.

ZeroOneZeroOneOnea at 2007-7-28 15:56:30 > top of Java-index,Desktop,Core GUI APIs...