Compiling and Testing Your Applet
- Be sure you are in your public_html directory (see above).
- Using a Unix editor, create a web page (filename.html) to invoke your applet.
with these two
lines in it (height and width may vary):
<applet code="filename.class" width="500" height="400">
</applet>
- Make this file readable by typing:
>chmod a+r filename.html
- Plan the code for your applet on paper first. You will save
time this way!
- Using a Unix editor, enter the code into a file. The file must have
the same name as the class. It must be
in your public_html directory on your mason
account. Save and exit the editor.
- Compile your program by typing:
>javac filename.java
- If you get an error message (and you probably will get many-this
is normal for beginners!) go back into pico and make changes. Then,
recompile.
- The compiled version will be named filename.class. Make this file readable
and executable by typing:
>chmod a+rx filename.class
- Once it compiles, launch a web browser and enter the URL for your
filename.html web page. It should be:
http://mason.gmu.edu/~yourloginname/filename.html
- If you make changes to your program, you must recompile it.
Then, in the web-browser, hold down the shift key while clicking
on the reload button. (Just "reloading" doesn't work. You have to
hold down the shift key.)
Click
here to return to the IT 108 class page
Copyright © 1999-2002 All Rights Reserved