BUG: IE print creates new instance of applet class to be printed (180046)



The information in this article applies to:

  • Microsoft virtual machine
  • Microsoft SDK for Java 2.0
  • Microsoft SDK for Java 2.01
  • Microsoft SDK for Java 2.02
  • Microsoft SDK for Java 3.0
  • Microsoft SDK for Java 3.1
  • Microsoft SDK for Java 3.2
  • Microsoft Internet Explorer (Programming) 4.0
  • Microsoft Internet Explorer (Programming) 4.01

This article was previously published under Q180046

SYMPTOMS

When printing an HTML-page in Microsoft Internet Explorer 4.x that contains a Java applet, IE creates a new instance of the applet class to be printed. In other words, you see only the initial, default state of the applet on the resulting printout and any changes the user made from the default state of the applet are not printed.

RESOLUTION

Currently, there are no supported workarounds for this bug.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

To reproduce this behavior, the following example can be used:
  1. Copy the following HTML code to a file named SimpleApplet.html:
    <HTML>
    <TITLE>
    SimpleApplet
    </TITLE>
    <BODY>
    Simple Applet<BR>
    <APPLET
      CODE     = "SimpleApplet.class"
      WIDTH    = 400
      HEIGHT   = 300>
    </APPLET>
    </BODY>
    </HTML>
    						
  2. Copy the following Java source to a file named SampleApplet.java:
    // SimpleApplet.java
    import java.awt.*;
    import java.applet.*;
    
    public class SimpleApplet extends Applet {
    
      TextField textfield = new TextField(30);
      Choice choice = new Choice();
    
      public SimpleApplet() {
              System.err.println("SimpleApplet SimpleApplet() "+this);
      }
    
      public void init() {
        System.err.println("SimpleApplet Applet.init() "+this);
    
        choice.addItem("Option 1");
        choice.addItem("Option 2");
        this.add(textfield);
        this.add(choice);
        validate();
      }
    
      public void start() {
          System.err.println("SimpleApplet Applet.start() "+this);
      }
    
      public void stop() {
          System.err.println("SimpleApplet Applet.stop() "+this);
      }
    
      public void destroy() {
          System.err.println("SimpleApplet Applet.destroy() "+this);
      }
    
      public void finalize() {
          System.err.println("SimpleApplet Applet.finalize() "+this);
      }
    }
    						
  3. Compile the SimpleApplet.java file using a Java compiler.
  4. Open the SimpletApplet.html file in Internet Explorer 4.x.
  5. Enter some text in the TextBox and set the Choice control to "Option 2."
  6. Click Print on the File menu in Internet Explorer 4.x and notice that the printout does not contain the text entered or the nondefault option in the Choice control.

REFERENCES

For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:6/14/2006
Keywords:kbArtTypeINF kbbug kbFAQ kbpending KB180046