CSCI A348/A548

Lab Notes 8

Fall 1999


This lab contains in-lab assignment 3: installing Java applets.

1. Create the source code of the applet.

For the purpose of this lab you will get the source code from me. We will install a fairly complex applet, and we will ignore the source code for now.

Take the following files

/u/dgerman/fall99/lab8/Matrix3D.java
/u/dgerman/fall99/lab8/XYZApp.java
from my home directory and put them in a special directory (called lab8) under your document root directory of your web server. Once you copy them you have the source code; that makes it as if you have written the source code yourself.
2. Compile them (prepare the bytecode).
Use javac to compile the source code. This will create a number of .class files that may or may not be in one-to-one with the source code (java) files. The number and names of the .class files can be deduced from the actual contents of the source code files. Of those created XYZApp.class is the main file and we need to make a note of that.
3. Prepare an .html file to distribute the applet.
Create an HTML file (call it index.html) in the same directory that has an applet tag inside it that looks like this:
<applet code=XYZApp.class width=100 height=100>
<param name=model value=models/benzene.xyz> 
</applet> 
Notice the param tag. It communicates important data to the applet, without which the applet won't run.
4. Prepare data for the applet.
Create a directory models inside the folder that contains your Java applets code. Copy all the *.xyz files from
/u/dgerman/fall99/lab8
to your models directory. They contain important rendering information for the applet. The fact that the applet is taking this info from a file is part of the actual design of the applet (it's a decision of the program writer).
5. Check your applet over the web.
You should see something like this.

Remember to use your mouse to rotate the 'benzene' molecule. The HTML doesn't say anything about that (although it should).

6. Improve your HTML interface.
Describe to the user what the page contains and what the user needs to do to interact with it. (See 7).
7. Show all other molecule models.
Here's an example for the benzene and ethane models.


What to turn in and when

Follow the guidelines above to install the molecule viewer applet before the due date, as posted. I will check the generic URL (/lab8/handin.html) for grading purposes and to verify that the applets have been installed.