Online Software Educational Training - IT Tutorials - Online Education Training for Computer Software


Home

JAVA APPLET

Running an  Applet

Create an HTML File that Includes the Applet

Using a text editor, create a file named Hello.html in the same directory that contains HelloWorld.class. This HTML file should contain the following text:

<HTML>
<HEAD>
<TITLE> A Simple Program </TITLE>
</HEAD>
<BODY>

<APPLET CODE="HelloWorld.class" WIDTH=150 HEIGHT=25>
</APPLET>
</BODY>
</HTML>

Run the Applet

To run the applet, you need to load the HTML file into an application that can run Java applets. This application might be a Java-compatible browser or another Java applet viewing program, such as the Applet Viewer provided in the JDK. To load the HTML file, you usually need to tell the application the URL of the HTML file you've created. For example, you might enter something like the following into a browser's URL or Location field:

file:/home/kwalrath/HTML/Hello.html

Click Here to run this Applet within your browser

 


Previous

Next