This section includes the following topics:
Information for Web Page Authors
Q: As a web page author, how do I use Java Plug-in Software?
A: To utilize all of the features and capabilities of Java 2 SDK, Standard Edition, web page authors must modify the page's HTML to specify the use of Sun's JRE via Java Plug-in Software. Sun is providing a written specification, to guide web page authors how to make these changes. In addition, Sun provides the Java Plug-in Software HTML Converter, free of charge, that will automatically make the changes to the HTML of a selected web page (or set of web pages).
Q: How can I get the the Java Plug-in Software HTML Converter?
A: Sun is distributing the Java Plug-in HTML Converter royalty-free as part of the J2SE SDK.
Q: How do I install and run the HTML Converter?
A: In this release of the HTML Converter, there is only one ZIP file for downloading for all platforms (Win32, Mac, UNIX, Java). See the Java Plug-in Product page for links to the latest information.
Q: How can I run the Java (.zip) version of the Java Plug-in Software HTML Converter after the installation?
A:See the Java Plug-in Product page for links to the latest information.
Q: What capabilities do the supplementary templates provided with the Java Plug-in Software HTML Converter provide?
A: The Java Plug-in Software HTML Converter provides both a default template (default.tpl), and three supplementary templates. These supplementary templates allow web page authors to more explicitly target the browsers and platforms used in their environment when modifying their pages using the Java Plug-in Software HTML Converter:
Q: How do I specify a JAR file as part of an OBJECT or EMBED tag?
A: You can specify one or more JAR files by defining an ARCHIVE parameter to the OBJECT or EMBED tag.
With the OBJECT tag this looks like:
<PARAM NAME=archive VALUE=demo.jar,fred.jar>
With the EMBED tag this looks like:
archive=demo.jar,fred.jar
Q: Does Java Plug-in Software support multiple JAR files in the ARCHIVE attribute in the APPLET tag? If so, why can't I get this to work?
A: The ARCHIVE attribute is supported in both the EMBED and OBJECT tags. The most common mistake is to put the JAR files in the wrong order. For example, if you use the Swing set in Java Plug-in Software and specify ARCHIVE="Myjar.jar,swing.jar,..." Java Plug-in Software will fail to load the applet because by the time Myjar.jar is loaded and Java Plug-in Software tries to initialize the applet, swing.jar is not yet loaded. The JAR files in the ARCHIVE should be in the order of dependency. Since Myjar.jar depends on everything else, it should be put at the end of the list. The other common mistake is to put spaces or paths with the JAR file lists.
Information for Applet Developers
Q: Do developers need to modify their applets in order to support Java Plug-in Software?
A: No. Any Java 2 SDK, Standard Edition, 100% Pure Java applets should run unmodified using the Java Plug-in Software.
Q: What is the applet lifecycle in Java Plug-in Software?
A: When an applet is encountered on an HTML page, the applet will be initialized and started. When the HTML page is closed, or the back button is pushed, the applet with be stopped and destroyed immediately.
When the same HTML page is encountered again, the applet will be initialized and started again.
Q: Does Java Plug-in Software support Drag and Drop between applets and the native environment? If so, why can't I get it to work?
A: Yes, Java Plug-in Software does support Drag and Drop. You must make sure to grant the applet the correct socket permissions using policytool to use this feature. Please see the SocketPermission class documentation for more information.
Q: How can I speed up applet download time?
A: There are several ways:
Q: How do I prevent the warning banner covering my GUI state?
A: You should use the getInsets() method to find the size of your frame's decorative border. This includes the warning banner. For example, if you create a Frame with size 100x100, you might find it has insets [top=42,left=5,bottom=5,right=6] giving you a drawable area of 89x53. You need to position your work within the drawable area.
If you need to create a drawable area of a particular size, first create and show the Frame, then use getInsets to find the insets' sizes, then figure out the desired frame size by adding your desired size to the insets, then use frame.setSize() to set your frame to that size.
Q: Why does InetAddress.getLocalHost().getHostName() return "localhost"?
A: This is a deliberate security feature in the Java 2 platform. Untrusted applets will not be given the real host name.
Trusted applets (such as signed applets) will be given the real host name.
For more information about these MIME types, please check the Java Plug-in Software HTML Specification.
Information for System Administrators
Q: I would like to change the Java Plug-in setting in thousands of machines through system management tools. What should I do?
A: Java Plug-in stores user specific settings under <user.home>/.java/properties<version>
.
Therefore, if administrators would like to change the Java Plug-in settting
globally, they may use system managment tools to update the file in all machines,
so Java Plug-in settings will be set globally.
Q: Does Java Plug-in Software replace Microsoft's or Netscape's Java runtime with Sun's JRE?
A: No. Java Plug-in Software does not replace the browser's underlying virtual machine. Rather, Java Plug-in Software simply enables web page authors to specify that Sun's JRE is used instead of the default Java runtime.
Q: What happens on browsers other than IE or Navigator, or on non-supported platforms?
A: The default conversion template provided with the Java Plug-in Software HTML Converter (used on the demonstration page), is designed such that the applet will not be rendered in browsers other than Internet Explorer and Netscape Navigator on unsupported platforms. However, the Java Plug-in Software HTML Converter provides additional templates allowing web page authors to specify that on non-supported platforms applets will be rendered using the original <APPLET> tag using the browser's default Java runtime.
Q: We are trying to deploy Java Plug-in Software within our intranet environment. The Java Plug-in Software HTML Specification and other online documents mention that we should set up a Netscape Plug-in Software installation page within our intranet for Netscape users to install Java Plug-in Software. What does this page do and how should we set it up?
A: The purpose of this installation page is to act as an entry point for Netscape users to install Java Plug-in Software. If users encounter an HTML page that requires Java Plug-in Software, the user will get redirected to this installation page according to the pluginspage attribute in the EMBED tag. At that point, the users should be able to download and install the correct version of Java Plug-in Software for their platform. Thus, the installation page should have link to download the Java Plug-in Software binary.
An simple example page would look like:
<HTML> <HEAD> <TITLE>Java Plug-in Software Download Page</TITLE> </HEAD> <BODY> <P><A HREF="ftp://myhost.com/public/jre14-win32.exe"> Java Plug-in Software for Windows</A> </P> <P><A HREF="ftp://myhost.com/public/plugin-14-solaris.bin"> Java Plug-in Software for Solaris</A> </P> </BODY> </HTML>Depending on how your webserver is configured, you may want to consider using CGI scripting instead of FTP for the download. Contact your webmaster for more information.
Q: Why is the download and installation experience different in Netscape Navigator than in Internet Explorer?
A: The releases of Netscape Navigator supported by Java Plug-in Software do not provide mechanisms that allow for the automatic download and installation of Java Plug-in Software, as in Internet Explorer. The first time Netscape Navigator comes across a web page that is enabled for Java Plug-in Software (the "activated page"), it redirects the user to another web page to download and install Java Plug-in Software on the user's system. The user must then return to the "activated page" to render the applet using Java Plug-in Software. From that point forward, the browser automatically invokes Java Plug-in Software each time it comes across web pages that supports the technology--completely transparent to the end user.