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

Swing applets do not display in appletviewer unless they are resized.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 7
    • 7
    • client-libs

      FULL PRODUCT VERSION :
      java version "1.7.0-ea"
      Java(TM) SE Runtime Environment (build 1.7.0-ea-b130)
      Java HotSpot(TM) Client VM (build 21.0-b02, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 x64
      Windows XP

      A DESCRIPTION OF THE PROBLEM :
      Swing-based applets (including HelloWorld applet from the Java tutorials) do not display in the appletviewer unless the viewer is resized. I have tried several applets, from several different sourcese, including the TumbleItem applet from the tutorials, and they all exhibit the same problem: none display in appletviewer unless the viewer is resized.

      The problem does NOT occur if the applet is executed in a browser. In otherwords, the swing-based applets work properly in a browser window, but not in the appletviewer.

      All swing-based applets worked properly in previous releases, include JDK 1.4, JDK 5, and JDK 6.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Try executing the HelloWorld applet from the Java tutorial using the appletviewer. Try the TumbleItem applet.

      Here is the html to try for the HelloWorld applet:

      <applet code="HelloWorld" width=300 height=100>
      </applet>

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      You should see output from the applet displayed inside the appletviewer.
      ACTUAL -
      You won't see output until you resize the appletviewer.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Use the HelloWorld.java code from the Java tutorials. Here is the link:

      http://download.oracle.com/javase/tutorial/deployment/applet/getStarted.html
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Call invalidate() after initializing the GUI.

      However, this fix is not very useful because it means that the example code provided by Oracle, and in many programming books, etc., won't work properly as-is in the appletviewer.

            alexp Alexander Potochkin (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: