Exercise 5: Java Applet - Simple
For a detailed Java information see
The Java Tutorial.
rite a java applet that will notifiy you when the applet has reached a major event in it's life cycle.
This is due in class on Monday.
It needs to be turned into your www directory in a seperate directory named ex5 or exercise5.
- First move into your web directory.
$ cd www
- Create a directory called 'ex5' or 'exercise5' and move into it.
$ mkdir ex5
$ mv ex5
- Create a file called Simple.java and type in the program given in
$ vi Simple.java
- Compile the source file.
$ javac Simple.java
- Create the HTML file needed to display the applet.
$ vi Simple.html
Simple.html will look like the following:
<TITLE>The Life Cycle Applet</TITLE>
<APPLET CODE="Simple.class" WIDTH=150 HEIGHT=25>
- To check your results open the Simple.html file in your browser.
Source code for Simple.java
A working copy of this applet