JavaT1.
Style
and choose default.html for the template.
<HTML>
<HEAD><TITLE>
Java Example 1
</TITLE></HEAD>
<BODY>
<applet code = "HelloWorld.class"
codebase="/saclasses/tutorials"
width=400
height=300>
</applet>
<BR> Press <A HREF="PageTwo">here</A> for Page Two !</BODY>
</HTML>
HelloWorld.class
is located in htmlroot
/saclasses/tutorials
. If it is not, the browser will be looking in the wrong place for the Java applet and you'll just get a message saying "applet not found."
You can play around with the parameters to alter the size of the area allocated to the applet, and change the paths to see how you can change the location of the applet. If you have the Java Development Kit (JDK), you can change the applet itself to see how the browser handles an applet's output.
HelloWorld.class
did not load correctly, it is probably because the codebase
part of your <applet>
statement does not accurately describe the location of your applets.
HelloWorld.class
should be located in the directory htmlroot
/saclasses/tutorials
, where htmlroot
is your Web server root. Your first step is to make sure that HelloWorld.class
is truly in this directory. If it is in the correct directory and your browser still can't find it, you may need to give your server a more precise description of the location.
codebase="/saclasses/tutorials"
codebase="
completeurl
"
completeurl
is the URL of the directory that contains HelloWorld.class
. For example, my codebase
statement readscodebase="http://deiweb/~dei/saclasses/tutorials"
HelloWorld.class
is in the directory~dei/public_html/saclasses/tutorials
.