| Main Page |
An applet is a little Java program that runs inside a Web browser.
The purpose of an applet is to extend the functionality of a Web page
in a browser. The HTML document tells the browser to load and run
an applet using the HTML tag <applet>. You
can write and test your applet in Eclipse. This page will explain
how you run an applet, and how to pass parameters to the applet,
as if the applet were being called by a browser.
This tutorial assumes you have downloaded the Eclipse project Welcome and imported it (as a .jar file) into Eclipse. (See import a jar for how.)
Welcome defined in this
file, which extends the applet class JApplet
This section assumes you understand how to run applets from the previous section. An HTML page can pass parameters to an applet. To run the Welcome applet from an HTML page, you would have the following in your HTML document
<applet class="Welcome.class">
<param name=MESSAGE value="Hello World!!">
</applet>
This particular applet displays the message "Welcome!!" as a default when
no parameter was passed. This was the case in the previous section.
This section will show you how to pass a parameter MESSAGE to
the applet in Eclipse.
MESSAGE for the "Name" field. Enter anything you
like on the "Value" field. Here is what I entered
| Main Page |