hide random home http://www.javasoft.com/applets/alpha/notapplets/appletviewer/index.html (PC Press Internet CD, 03/1996)

Arthur's Applet Viewer

Arthur's Applet Viewer

I have written a little productivity tool that lets you view applets in a seperate window outside the HotJava browser. This is useful when you are developing applets or you don't want to create a html file containing the applet.

The applet viewer is not an Applet itself. It is a Java program that you have to run in the Java interpreter. Check out the man page for the Java interpreter on how to run Java programs.

To run an applet in a window you have run the AppletViewer class at the command line as follows:

    java AppletViewer <documenturl> class=<classname> \
	 <att2>=<val2> <att3>=<val3> ...
The program is written in Java. The first argument is the URL which will be used as the document url (the URL of the document in which the applet would have been embedded). The rest of the arguments are just attribute definitions of the form ATTNAME=ATTVALUE.

Examples

To run the TicTacToe demo (from the release) in a window use:
    java AppletViewer doc:/demo/ class=TicTacToe
The following example uses the AudioItem applet to play spacemusic:
    java AppletViewer doc:/demo/ class=AudioItem \
	 snd=audio/spacemusic.au
You are not restricted to running applets from your own machine. Use the following to run the speaking clock applet from my external home page:
    java AppletViewer http://java.sun.com/people/avh/ \
         class=DateItem translator=EnglishTime speaker=avh \
	 width=150 height=35

How to get it

Take a look at the code for the applet viewer in AppletViewer.java or download it all from ftp://java.sun.com/pub/java/avh/appletviewer.tar.Z (4Kb).


avh@eng.sun.com