BUG: IE Print Creates New Instance of Applet Class to Be PrintedID: Q180046
|
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.
Currently, there are no supported workarounds for this bug.
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
To reproduce this behavior, the following example can be used:
<HTML>
<TITLE>
SimpleApplet
</TITLE>
<BODY>
Simple Applet<BR>
<APPLET
CODE = "SimpleApplet.class"
WIDTH = 400
HEIGHT = 300>
</APPLET>
</BODY>
</HTML>
// 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);
}
}
For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java,
please see the following pages on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/
http://support.microsoft.com/support/java/
Additional query words: print instance applet
Keywords : kbnokeyword kbGenInfo kbSDKJava300 kbVJ kbSDKJava310 JCOM JVM kbSDKJava320
Version : WINDOWS:2.0,2.01,2.02,3.0,3.1,4.0,4.01; Winnt: 4.0,4.01
Platform : WINDOWS winnt
Issue type : kbbug
Last Reviewed: July 9, 1999