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

problem w pluggin/Netscape & APPLET WIDTH/HEIGHT percent values

XMLWordPrintable

    • beta
    • x86
    • generic

      Problem
      -------
      Java Plug-In 1.2.2/1.3 does not work under Netscape 4.6;4.7/Win 95;Win NT
      with percentage values set for the WIDTH & HEIGHT parameters of the
      APPLET HTML tag.
      This feature is part of the HTML 4.0 spec and works perfectly with the above
      on a solaris/sparc platform.
      It also works correctly with Internet Explorer 5.0 on Win 32 Platform.
      The effect is that if the browser window is resized to a smaller value
      the applet will not resize correctly but clip. This is very undesireable
      behaviour.

      Code Example
      ------------
      /****************************** test1.html ****************************/
      <HTML>
      <HEAD>
      <TITLE>
      HTML Test Page
      </TITLE>
      </HEAD>
      <BODY>
      SimpleApplet will appear below in a Java enabled browser.<BR>
      <!--"CONVERTED_APPLET"-->
      <!-- CONVERTER VERSION 1.3 -->
      <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
      WIDTH = 50%
      HEIGHT = 300
      NAME = "TestApplet" ALIGN = middle VSPACE = 0 HSPACE = 0
      codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
      <PARAM NAME = CODE VALUE = "SimpleApplet.class" >
      <PARAM NAME = CODEBASE VALUE = "." >
      <PARAM NAME = NAME VALUE = "TestApplet" >
      <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
      <PARAM NAME="scriptable" VALUE="false">
      <COMMENT>
      <EMBED type="application/x-java-applet;version=1.3" CODE = "SimpleApplet.class" CODEBASE = "." NAME = "TestApplet" WIDTH = 50% HEIGHT = 300 ALIGN = middle VSPACE = 0 HSPACE = 0 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED></COMMENT>

      </NOEMBED></EMBED>
      </OBJECT>

      <!--
      <APPLET CODE = "SimpleApplet.class" CODEBASE = "." WIDTH = 50% HEIGHT = 300 NAME = "TestApplet" ALIGN = middle VSPACE = 0 HSPACE = 0>

      </APPLET>
      -->
      <!--"END_CONVERTED_APPLET"-->

      </BODY>
      </HTML>

      /****************************** end test1.html **************************/

      /**************************** SimpleApplet.java *******************/
      import javax.swing.*;
      import java.awt.*;

      public class SimpleApplet extends JApplet {
        public SimpleApplet() {

          // supress warning message
          getRootPane().putClientProperty("defeatSystemEventQueueCheck",
          Boolean.TRUE);
        }

        public void start() {
          SwingUtilities.invokeLater(new Runnable() {
            public void run() { // run in the event thread . . .
              JPanel p = new JPanel();
              p.setLayout(new GridLayout(2, 2));
              p.add(new JButton("Box1"));
              p.add(new JButton("Box2"));
      p.add(new JButton("Box3"));
              p.add(new JButton("Box4"));
              Container content = getContentPane();
              
              content.add(p);
              validate();
            }
          });
        }
      }
      /**************************** end SimpleApplet.java *******************/

      To Reproduce
      ------------
      1. Compile the above java code SimpleApplet.java using jdk1.2.2
         ie javac SimpleApplet.java

      2. Install netscape 4.7 and java_plugin 1.3 on pc running nt.

      3. Point netscape browser at file test1.html.

      4. The image will be displayed occuping 50% of browser window.

      5. Resize browser window to half its original width. The underlying image
         will not scale but will be clipped.

      6. Repeat the same test using Internet Explorer 5.0. It will resize
         the image correctly and it will not be clipped.

      7. Repeat the above tests on sparc solaris + netscape. The resize
         will also work correctly

      Circumstance/Expectations
      -------------------------
      To fix problem.

      Other Related Information
      -------------------------
      see bug id 4144622

            stanleyh Stanley Ho (Inactive)
            hszyszko Henry Szyszko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: