This routine
prints out Hello World
to a browser window:
import
java.applet.Applet;
import java.awt.Graphics;
public
class HelloWorld extends Applet {
public void paint(Graphics
g) {
g.drawString("Helloworld!"
,50,25);
}
}
Put this code into a file called
HelloWorld.java
Then compile
the application with
This creates
the class file
Create an html file to hold the
applet. Put the following code into a file called HelloWorld.html
in the SAME
directory as the class file.
Loading the file HelloWorld.html
into
your browser will display the following
output: