Basic HTML version of Foils prepared Oct 1 98

Foil 8 Java Applets

From Java Tutorial 98- 1: Introduction to Java Language and Applets CPS606 -- Fall Semester. by Geoffrey C. Fox, Nancy McCracken


1 Java applets are classes written in Java which are intended not to run as stand-alone programs (as applications do) but as subprograms of a browser which is already managing a window.
2 Applets should NOT have main method but rather init, start, paint etc. for displaying on the browser window
3 The applet should be run through javac compiler getting a .class file as before: javac MyApplet.java
4 The resulting file MyApplet.class is then stored in the document collection of a web server (hence has a URL location).
5 Also create an HTML file (say MyApplet.html) with an applet tag to MyApplet.class.
  • <APPLET codebase="http://myserver.org/mydirectory"
  • code = "MyApplet.class" width=300 height=100>

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998