Note: This Java plug-in guide describes features released prior to the Java SE 6 update 10 release. See Java Rich Internet Applications Development and Deployment for the latest information.
APPLET
Tag Support in JavaTM
Plug-in
NoteFor more information about compatibility issues between the
Microsoft VM and Sun's, see Appendix 4: Microsoft VM and Java Applet
Compatibility Issues. |
Q: Why should I encourage people to use the Java
Platform?
A: The Java Platform is richer than its predecessors in functionality, performance, and security options. As a developer, you want the users of your software to have the most feature-complete Java platform possible so that the full range of APIs and libraries are available for your applications. If your customers are using the Java Platform, you can write more powerful, robust, and full-featured applications and applets. And with the Java Platform the performance of your code will be better too.
By using the latest Java Plug-in with APPLET tag support, you can help to ensure that clients running your applets will have the latest Java Platform.
Q: Can I continue to use OBJECT tags to call my applets?
A: Yes. Even though the Java Plug-in has been enhanced to support APPLET tags, it is fully backward compatible with existing web pages that use OBJECT tags to launch applets.
Q: My applet fails with a ClassFormatError
.
What's wrong?
A: This problem may be caused by bytecode generated by old compilers. Such bytecode may not conform to the virtual machine specification, which is more strictly enforced by recent releases of the JRE.
Q: Why doesn't Java Plug-in load my applet's cab file?
A: The Java Plug-in supports applet packaging in
.jar
files. It does not support the Microsoft
proprietary .
cab
file format.
Therefore any applets packaged in Microsoft's
.
cab file
format will not load in
JRE/Java Plug-in.
Q: Will my Authenticode-signed applet work with Sun's JRE/Java Plug-in?
A: No. The Sun JRE/Java Plug-in does not support
Microsoft proprietary technology such as Authenicode signing and
.
cab
file formats. Signed applets
that rely on Microsoft's Authenticode technology will not load in
JRE/Java Plug-in.
Q: My applet uses J/Direct, AFC, and WFC, etc. Will it work in Sun's JRE/Java Plug-in?
A: No. Libraries for these and other proprietary Microsoft technologies are not included with JRE/Java Plug-in. Applets that rely on these Microsoft proprietary technologies will not work properly when run on JRE/Java Plug-in.
Q: Why does my applet throw a
NullPointerException
from the AWT Dispatch Event
thread?
A: The events that occur during applet startup and shutdown may differ between the Microsoft and Sun implementation of the Java platform. For example, the logic in an applet may rely on the applet being visible when Applet.start()/Applet.stop() is called. That condition may be true when the applet is run on Microsoft's implementation but may not be true on Sun's impelementation.
Applets that rely on specific events that occur during startup and shutdown on Microsoft's implementation of the Java platform may not work properly with JRE/Java Plug-in. The most common symptom of this type of problem is a NullPointerException from the AWT Dispatch Event thread.
Q: Why does my applet throw a ClassCastException
from the AWT Dispatch Event thread?
A: The number of containers between the applet and the encompassing frame are different in the Microsoft and Sun implementations. Therefore, an applet that relies on the frame being at some particular level of containment in the Microsoft VM, without navigating the entire AWT hierarchical component tree, is likely to fail when run on Sun's JRE/Java Plug-in. The most common symptom of this problem is a ClassCastException from the AWT Dispatch Event thread.
Q: Does Java Plug-in support Java-JavaScript communication?
A: Yes, Java Plug-in supports basic, bidirectional Java-JavaScript communication. The following, however, is a known incompatibility.
In the Microsoft implementation, applet methods and properties exposed in JavaScript are exactly the same as the methods and fields in the applet object. In Java Plug-in, an applet's methods and properties are exposed in JavaScript through JavaBeansTM introspection, which treats the applet's fields in a different manner than the Microsoft VM. Therefore, JavaScript accessing fields in an applet object may not work the same when run on JRE/Java Plug-in.