BUG: JApplet paints white during jar download 1.6.0_01

Can anyone else confirm/duplicate this?

When a JApplet starts it correctly shows the color specified by the boxbgcolor parameter for a moment, then when it starts to download jars it goes white until the jars are finished. Finally it paints the color specified in start(). I don't know if this applies to Applet, too, but I would guess that it does.

So if you have a jar of any size and server/network/internet service that is not blazingly fast the white can show for a while. Not every html page has a white background.

Below is code the shows the problem. When you set up to run this, include a huge jar in the archive tag downloaded from a slow server. Maybe you could add a whole bunch of large jars locally. I can see the problem that way, but it's very fast.

What you'll see is the applet go red, then white, then orange. I think it is a bug that it goes white. It should stay red until the jars are loaded. An image instead of a color does not seem to help.

Yes, there are solutions via javascript to hide the applet until it loads completely, but the simple solution that should work with boxbgcolor is what I'm addressing.

import javax.swing.*;

import java.awt.*;

publicclass PaintTestextends JApplet{

publicvoid start(){

getContentPane().setBackground(Color.ORANGE);

}

}

and the html:

<html>

<head>

<title>PaintTest</title>

</head>

<body>

<h1>PaintTest</h1>

<hr>

<object id="PaintTestApplet" classid="clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA"

width="300" height="200" align="center" valign="center"

codebase="/software/jre/jre-6u1-windows-i586-p.exe#Version=1,6,0,1"

border="0">

<PARAM name="boxbgcolor" value="#FF0000">

<param name="archive" value="applet.jar,insertlargejarhere.jar"/>

<param name="code" value="PaintTest"/>

</object>

<hr>

</body>

</html>

Message was edited by:

jculli

[2755 byte] By [jcullia] at [2007-11-27 10:15:53]
# 1

I submitted this as a bug and it was accepted.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6586210

jcullia at 2007-7-28 15:42:11 > top of Java-index,Desktop,Deploying...