Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6586210

Applet paints white during jar download

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 7
    • 6
    • deploy
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.6.0_01"
      Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
      Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 5.2.3790]
      XP 64-bit

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Internet Explorer 7.0.5730.11

      A DESCRIPTION OF THE PROBLEM :
      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 as well as JApplet.

      If you have a jar or multiple jars 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.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      When you set up to run this, include a huge jar or a long list of jars in the archive tag and set up to download them from a slow server. Maybe you could add a whole bunch of large jars locally. I can see the problem that way, but it goes by very fast.

      There are solutions via javascript to hide the applet until it loads completely, but the simple solution that should work with boxbgcolor is the bug.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The background color should stay red (specified by boxbgcolor) until the jars are loaded. An image instead of a color does not seem to help.
      ACTUAL -
      What you'll see is the applet go red (boxbgcolor), then white, then orange (specified in applet code).

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.awt.*;
       
      public class PaintTest extends JApplet {
          public void start() {
              getContentPane().setBackground(Color.ORANGE);
          }
      }


      <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>


      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Find on the web and use one of various methods in Javascript to hide the applet until the applet calls back into the Javascript to show itself.

            alin Audrey Lin (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: