HomeArticlesFAQsXREFGamesSoftwareInstantBooksBBSAboutFOLDOCRFCsFeedbackSearchSite-Map
logo

Java Applets #2 - compile

You are here: irt.org | Articles | Java | Java Applets #2

Published on: Saturday 21st March 1998 By: Tarique Sani

Editing

The source code for your applet must be contained in a text file whose name is same as that of your applet class and the extension of this file must be .java. Thus for our example the file name would be "Simple.java". Remember - these names are case sensitive.

Compiling

Once you have got your source file ready you can compile it by running the java compiler, from a DOS window or an Xterm window depending upon your OS. The command is as follows:

javac Simple.java

If there are any mistakes in your source code the compiler will point it out.

Running

You can run your applet in any of the following ways

Execute - appletviewer Simple.java (This will work only if you included the default HTML in your source code)

Execute - appletviewer Simple.html (The HTML file with the relevant <applet> declaration).

Open the Simple.html document in a java compatible web browser.

View the profile on Tarique Sani and the list of other Articles by Tarique Sani.

©2011 Martin Webb