Basic HTML version of Foils prepared 20 Sept 97

Foil 6 Running a Java Applet

From Java Tutorial - Summer 1997 Part 1:Introduction to Java Language CEWES Tutorial, Classes SU/Jackson State -- July 22-25 and Fall 97. by Nancy J. McCracken,Geoffrey C. Fox


Steps to running a Java Applet:
  • 1. Write an HTML file that refers to the applet using the APPLET tag, described in later pages.
  • 2. If necessary, write the Java code and compile into class files
  • 3. Visit the HTML file with a web browser or with appletviewer.
Using a Browser
  • With a Java-enabled web browser, such as Netscape 2.0/3.0 or HotJava, you run an applet by "surfing" to a web page containing the APPLET tag.
Using appletviewer
  • When doing development, use appletviewer to run applets by specifying the HTML file on the command line:
    • appletviewer stock.html



© on Sun Oct 12 1997