AppletViewer

   

Applets are programs written in Java that are designed to run embedded in an HTML document, just like a Web page. Under most circumstances, they don't have the capability to run by themselves . The AppletViewer tool is a small program that lets you run applets without having to launch a Web browser each time you want to test your applet code. It's a quick and easy way to test your applets as you're developing them.

You call the AppletViewer with the following command:

 appletviewer <options> URLs... 

The URLs in the command line are the Uniform Resource Locators to HTML files that contain applet tags (such as http://www.javasoft.com/index.html). Alternatively, if you're in a directory that has an HTML file that references an applet, you can call AppletViewer by typing in the name of the HTML file that contains the applet tag. The following option is available:

Option Description
- debug Starts the AppletViewer in the Java debugger.
-encoding Specifies character encoding used by HTML files.

With the SDK 1.3, the HotSpot client Virtual Machine is the default virtual machine. It provides increased performance over the previous class virtual machine. However, you can still invoke the classic virtual machine with the AppletViewer by providing an addition parameter like this:

 appletviewer classic URL 

URL is the HTML file that contains the APPLET tag. By default, the HotSpot virtual machine will be used unless this additional parameter is specified.

The Applet menu in the AppletViewer window enables you to set a number of different functions. Those menu options are as follows :

  • Restart ” Restarts the applet using the current settings.

  • Reload ” Reloads the applet. Changes in the class file are applied upon reload.

  • Stop ” Causes the stop() method of the applet to be called and halts the applet. Note that the applet is not destroyed in this example as it is with Reload.

  • Save ” Saves the serialized state of the applet.

  • Start ” Starts the applet. This is useful when the Stop option has been used. If the applet has not been stopped , it has no action.

  • Clone ” Duplicates the current applet, using the same settings to create another AppletViewer instance.

  • Tag ” Shows the HTML applet tag that is used to run the current applet, as well as any parameters that are passed to the applet from the HTML tag.

  • Info ” Shows special information about the applet, which is set within the applet's program.

  • Edit ” This doesn't appear to do anything; it has been grayed out since the first beta.

  • Print ” Causes the applet's PrintGraphics to be sent to a printer.

  • Character Encoding ” Specifies the character encoding for the HTML files.

  • Properties ” Shows the AppletViewer security properties. These settings enable you to configure AppletViewer for a network environment that includes a firewall proxy, or an HTTP proxy, using the relative proxy server and proxy port boxes. The Network Access box allows you to select the type of network access that AppletViewer is allowed. The choices are No Network Access, Applet Host (default), and Unrestricted. The Class Access box enables you to choose what kind of access ”Restricted or Unrestricted ”you want AppletViewer to have on other classes.

  • Close ” Closes the AppletViewer window and terminates the applet.

  • Quit ” Closes the AppletViewer window and terminates the applet.

   


Special Edition Using Java 2 Standard Edition
Special Edition Using Java 2, Standard Edition (Special Edition Using...)
ISBN: 0789724685
EAN: 2147483647
Year: 1999
Pages: 353

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net