The "Hello World" applet is a simple applet that displays the string "Hello world!".
import java.applet.Applet; import java.awt.Graphics; public class HelloWorldApplet extends Applet { public void paint(Graphics g) { g.drawString("Hello world!", 50, 25); } }Each time the applet needs to be redisplayed its paint method is called.