Java Applet or Java Application?

My Java programs can be used as an Applet (embedded in a Web page) or as standalone Java applications. In both cases you will need some archive files, which contain the complete application and utility class trees. These archives come in the form of Java ARchives (.jar) files.



An applet can be run either by loading the HTML page into your Java enabled web browser (e.g. Microsoft Internet Explorer, Netscape Navigator, Opera, etc.) or by using the AppletViewer program provided for several platforms by Sun Microsystems.
Running as an applet in your browser is probably the easiest way to use the Java Programs and it offers the benefit that you will always get the latest version over the net.
A disadvantage may be, that you cannot save, print or copy data to the clipboard, as long as you use the standard Java security settings of your browser. If you lower these restrictions for all Java programs, you should reset them before surfing into the unknowns of the web in order to avoid that someone malicious can read or write files on your computer system.

In Microsoft Internet Explorer™, you have a better option: You can declare single web sites as "trusted" and assign individual security restrictions (file access permission, printing permission) to them. You have to perform the following steps to do so:

  • Use the menu Extras - Internet-Options to show a dialog box and select the Security card.
  • Select the green checkmark Trusted Sites and push the Sites... button to open a new dialog box.
  • Here you add the web site you are trusting, e.g. and close the Trusted Sites dialog box.
  • Adjust the security settings for this Trusted Sites zone by opening a new dialog box and another one for the Java settings:
    - you should allow access for non signed applications (like JavaFoil or JavaProp).
  • Closing all open dialog boxes should put the new settings into action - Phew!
  • Reload the page from the site.

You will then see a jp_trusted.jpg (2973 Byte) sign in the status line whenever you work with one of the trusted sites.  All other web sites will still use the safe security settings (no checkmark).


In Netscape Navigator™ and Opera I could not find a way to define individual security settings for a site. In Suns HotJava, you can at least allow file access, but I could not allow access to the printer (which is ridiculous, as file access could be much more dangerous than printing).

Normally, your browser will cache the Java archive, so that you can even run it offline after disconnecting from the net (of course only until you clear or overflow the cache buffer).



Running a program as a Java standalone application makes use of the Java runtime environment and the Java loader, which is usually called java on Unix or either java or wjava under Microsoft Windows. The Java loader loads the main .class file and all related classes from the .jar archive(s), which must be either in the same directory, in one of the directories listed in the CLASSPATH environment variable, or you must specify the path on the command line.

Microsoft Windows:

If you have placed an main archive file like javaprop.jar and the helper classes mhclasses.jar in your current directory, you can run JavaProp by entering the following command line in the DOS command prompt window:

java -cp ./javaprop.jar;./mhclasses.jar MH.JavaProp.JavaProp

or, if these archive files are in the java subdirectory:

java -cp ./java/javaprop.jar;./java/mhclasses.jar MH.JavaProp.JavaProp

Remark: In Microsoft Windows you can also create an icon and associate one of the above command lines with it.

UNIX Systems:

On a UNIX system, you would probably enter a command line like (line is folded to fit on page):

java -classpath ./javaprop.lar:./mhclasses.jar:
     /usr/java/lib/rt.jar:/usr/...path... MH.JavaProp.JavaProp

The trailing classpath elements depend on your local installation; path separator is a ":".

If you run JavaProp as a standalone application, using java, it can access the file system, the clipboard and your printer without changing any browser settings.

Last Resort: use the unpacked archives:

A few Java implementations may have problems with multiple .jar archives. In this case, you can unpack these archives to a directory tree, which will then contain the raw .class files. You will create one tree of utility classes from mhclasses.jar starting in the directory MH under the applet directory and all the application classes in the applet directory.

The directory structure will look similar to the one shown at the left.
All the application classes will be in the Applet Directory above the MH directory. The utility classes will go into directories of their own under the MH directory.

You can then run the main class in the Applet Directory using a command like:

java JavaProp.class



Versions and Browsers

Some users have reported problems with Java Programs.  A typical sign of these problems were missing or badly painted scrollbars on the tables.  If you encounter such anomalies, your Java installation may be buggy or too old.  You should have at least Java 1.1, and on some Microsoft Windows™ systems it might be necessary to update the Java virtual machine (VM) and the runtime environment (JRE).  This can be done by installing the latest version of Internet explorer (custom setup) or by downloading and installing these files from the Microsoft or Sun web server (see below).  There is no need to install the development toolkit (JDK) if you do not intend to write programs in Java; in order to run Java programs, the runtime environment (JRE) is sufficient.

The following versions have been tested and work well:

  • Windows 98, Sun Java 2, 1.4.1
  • Windows 98, IE 5.5, Java 1.1.4, Microsoft Java VM 5.0
  • Windows 98, Sun Java 2, 1.3.0
  • Windows 98, Netscape 6.0: Java 1.3.0
  • Windows 2000, IE 5.0, Java 1.1.4
  • Windows 2000, Opera 5.11, Sun Java Runtime Environment 1.3
  • Windows XP, IE 6.0, Sun Java Plug-in versions 1.4.2_02 to _04
  • HotJava for Windows, MacOS, Solaris, Version 3.0,

Under Netscape on an IRIX machine I found a quite slow and somewhat buggy Java VM.


Java Web Start

The latest Java releases come with a technology called Java Web Start for deploying applications via a web site. The Web Start application caches all files so that you can later run the application without accessing the internet.

Instructions if you have the latest Java version installed (Java 1.5)

  • Download and start JavaFoil automatically by clicking on this link: JavaFoil.
  • Download and start JavaProp automatically by clicking on this link: JavaProp.
  • Download and start JavaPipe automatically by clicking on this link: JavaPipe.

Instructions if you have an older Java version and Java Web Start (Java 1.4 or below)

  • If you want to install Java Web Start visit Suns web site at for availability of Java Web Start downloads.
  • Start the Java Web Start application (German version shown):
  • Enter the address
    into the address field and press the RETURN or the TAB key to see all available applications.
  • The Web Start application will scan the address and show you all available applications.
  • When you start an application for the first time, you are asked whether you trust it and allow access to files, printer etc. If you grant access, you can run it like a normal application.
  • You can later work offline, because Java Web  Start will cache the application files.
  • For Java 1.5 see


You can supply command line arguments to customize my Java programs. When you are running a standalone application you can pass any desired parameters either as a command line argument at the end of the command line, or as a system property using the -D option of the java command. A typical command line equivalent to the <PARAM> tags in an HTML file below would be:

java -cp .\javaprop.jar;.\mhclasses.jar -DCountry=USA -DFontSize=16 -DScreenCharset=ASCII MH.JavaProp.JavaProp


javaw -cp .\javaprop.jar;.\mhclasses.jar -DCountry=USA -DFontSize=16 -DScreenCharset=ASCII MH.JavaProp.JavaProp

The difference between java and javaw is that java blocks the command line and prints its error messages to the command window; whereas javaw does not output error messages and runs in a separate thread (not blocking the console).

Alternatively, if you want to use the applet version, you can use a modified HTML applet page. Then you supply the parameters by <PARAM> tags inside the <APPLET>  or <OBJECT> tag. The HTML code looks like:

Using the  <APPLET> tag Using the <OBJECT> tag
<APPLET NAME="JavaPropApplet"
        WIDTH="600" HEIGHT="640">
   <PARAM NAME="Country"       VALUE="USA">
   <PARAM NAME="FontSize"      VALUE="16">
   <PARAM NAME="ScreenCharset" VALUE="ASCII">
<OBJECT ID="JavaPropApplet"
        CODEBASE="./javaprop.jar ./mhclasses.jar"
        WIDTH="600" HEIGHT="640">
   <PARAM NAME="Country"       VALUE="USA">
   <PARAM NAME="FontSize"      VALUE="16">
   <PARAM NAME="ScreenCharset" VALUE="ASCII">

You then use your browser to load the applet page.


You can use any of the following parameters for customization of JavaFoil and JavaProp:

Parameter Name possible Values Comment
hex RRGGBB color for toolbar and status line background
country for language (default: USA)
the font size in points, used for screen display (default: 12pt)
ASCII | Unicode
symbol set for screen display (default: Unicode)
ASCII | Unicode
symbol set for the printer (default: Unicode)
ASCII | Unicode
symbol set for file and clipboard transfer (default: Unicode)

Symbol Set Parameters

Each Java implementation should support the full Unicode character set, but some systems have problems with this. Typically, everything looks nice on screen, but you may receive funny characters or black blobs on printout or in saved files. Then you should try to set the corresponding ...Charset to ASCII. Greek characters (available in Unicode only) will be replaced with a text version like alfa or beta.

Additional Parameters for JavaProp:

Parameter Name possible Values Comment
number of blade elements (default: 40, reasonable: 20-40)

Additional Parameters for JavaFoil:

Parameter Name possible Values Comment
path and name of script file

JavaFoil Scripting Edition only



How to download a Java program for usage as a standalone Application?

Instructions can be found at the bottom of each applet page.

How to get a Java Virtual Machine (VM)?

Sun offers ist VM for many platforms on its web site at On this web site you should always be able to find the most recent version of the Java VM for your system.

Last modification of this page: 02.05.07

[Back to Home Page] Suggestions? Corrections? Remarks? e-mail: Martin Hepperle.

Due to the increasing amount of SPAM mail, I have to change this e-Mail address regularly. You will always find the latest version in the footer of all my pages.

It might take some time until you receive an answer and in some cases you may even receive no answer at all. I apologize for this, but my spare time is limited. If you have not lost patience, you might want to send me a copy of your e-mail after a month or so.
This is a privately owned, non-profit page of purely educational purpose. Any statements may be incorrect and unsuitable for practical usage. I cannot take any responsibility for actions you perform based on data, assumptions, calculations etc. taken from this web page.

© 1996-2006 Martin Hepperle
You may use the data given in this document for your personal use. If you use this document for a publication, you have to cite the source. A publication of a recompilation of the given material is not allowed, if the resulting product is sold for more than the production costs.

This document may accidentally refer to trade names and trademarks, which are owned by national or international companies, but which are unknown by me. Their rights are fully recognized and these companies are kindly asked to inform me if they do not wish their names to be used at all or to be used in a different way.

This document is part of a frame set and can be found by navigating from the entry point at the Web site

Impressum und weitere rechtliche Hinweise für Deutschland