The Simplest Java Applet: Hello, World!
Java applets can call methods to display on a screen (within the browser window). One way is to call the method drawString() from the standard method paint().
import java.awt.Graphics;
public class HelloApplet extends java.applet.Applet {
public void paint (Graphics g) {
g.drawString(“Hello World!”, 5, 25);
The import statement (similar to an include) allows the use of methods from the Graphics class .
The paint() method displays a graphics object on the screen - one of the standard methods that takes the place of main() for applets.
Makes this a subclass of Applet.