JDK-6363382 : JApplet fails to draw as expected on Windows
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-12-14
  • Updated: 2010-04-08
  • Resolved: 2005-12-19
Related Reports
Relates :  
Using Mustang build-62 an Applet that extends JApplet fails to re-draw as expected when moved around the screen.  Extending from Applet works fine and running the following code under Tiger works fine.  The problem can be reproduced using the Appletviewer.

The code that fails:
public class MyApplet extends JApplet {
    public void paint(Graphics g) {
        g.drawString("Hello World!", 50, 25);

A link to a sample Applet:

EVALUATION While this is a regression I don't imagine any customers having apps like this. The rationel for this is that if you override paint in the way this test case does none of the children will be painted, and you won't get any specified background color. I'm closing out.

EVALUATION This behavior is happening because we're disabling native erase and the applet subclass is not filling in the background.

EVALUATION You can see the same behavior in 1.5 if you set the sun.awt.noerasebackground system property to true.