previous up next
Go backward to 2.3 Asserting Conditions
Go up to 2 Using the Toolkit
Go forward to 2.5 Writing Applets
RISC-Linz logo

2.4 Compiling the Program

Assuming that all of the code presented in the previous section is contained in a file Main.java, that the DAJ toolkit is appropriately installed, and of course that Java is running on your system, you can compile the program by executing

javac Main.java

The program may be then called in stand-alone mode by calling

java Main

By creating a HTML file Main.html and inserting the code

<APPLET code="Main.class" 
  width=120 height=30
  alt = "Your browser does not support Java.">
  <param name=buttonLabel value="Press me">
Please enable Java!
</APPLET>
you can embed the application as an applet in a Web page. Calling e.g.
  appletviewer Main.html

allows you to test the applet.


Maintainer: Wolfgang Schreiner
Last Modification: November 14, 1997

previous up next