appletviewer (original) (raw)

11/65

Note: You use the appletviewer command to launch the AppletViewer and run applets outside of a web browser. Although available and supported in JDK 9, the Applet API is marked as deprecated in preparation for removal in a future release. Instead of applets, consider alternatives such as Java Web Start or self-contained applications.

Synopsis

appletviewer [options] url...

options

Specifies the command-line options separated by spaces. See Options for appletviewer.

url

Specifies the location of the documents or resources to be displayed. You can specify multiple URLs separated by spaces.

Description

The appletviewer command connects to the documents or resources designated by url and displays each applet referenced by the documents in its own AppletViewer window. If the documents referred to by url don’t reference any applets with the OBJECT, EMBED, or APPLET tag, then the appletviewer command does nothing. The OBJECT, EMBED, and APPLETtags are described in AppletViewer Tags.

The appletviewer command requires encoded URLs according to the escaping mechanism defined in RFC2396. Only encoded URLs are supported. However, file names must be unencoded, as specified in RFC2396.

Note:

The appletviewer command is intended for development purposes only.

Options for appletviewer

-encoding encoding-name

Specifies the input HTML file encoding name.

-Jjavaoption

Passes the string javaoption as a single argument to the Java interpreter, which runs the AppletViewer. The argument shouldn’t contain spaces. Multiple argument words must all begin with the prefix -J. This is useful for adjusting the compiler's execution environment or memory usage. Seejava command documentation for more information about JVM options.

AppletViewer Tags

The AppletViewer makes it possible to run a Java applet without using a browser.

The AppletViewer ignores any HTML that isn’t immediately relevant to launching an applet. However, it recognizes a wide variety of applet-launching syntax. The HTML code that the AppletViewer recognizes is described in this section. All other HTML code is ignored.

object

The object tag is the HTML 4.0 tag for embedding applets and multmedia objects into an HTML page. It’s also an Internet Explorer 4.n extension to HTML 3.2 which enables IE to run a Java applet using the latest Java plug-in.

<object width="pixelWidth" height="pixelHeight"

...alternate-text

Note:

embed

The embed tag is the Netscape extension to HTML 3.2 that allows embedding an applet or a multimedia object in an HTML page. It allows a Netscape 4.n browser (which supports HTML 3.2) to run a Java applet using the Java plug-in.

<embed code="yourClass.class" object="serializedObjectOrJavaBean" codebase="classFileDirectory" width="pixelWidth" height="pixelHeight"

...

Note:

applet

The applet tag is the original HTML 3.2 tag for embedding an applet in an HTML page. Applets loaded using the applet tag are run by the browser, which may not be using the latest version of the Java platform. To ensure that the applet runs with the latest version, use the object tag to load the Java plug-in into the browser. The plug-in then runs the applet.

<applet code="yourClass.class" object="serializedObjectOrJavaBean" codebase="classFileDirectory" width="pixelWidth" height="pixelHeight"

...alternate-text

Note:

app

The app tag was a short-lived abbreviation for applet that’s no longer supported. The AppletViewer translates the tag and prints an equivalent tag that’s supported.

<app class="classFileName" (without a .class suffix) src="classFileDirectory" width="pixelWidth" height="pixelHeight"

...