![]() ![]() ![]() ![]() |
The "Hello World" Applet |
[UNDER CONSTRUCTION]This page will discuss (or lead to pages that discuss) the anatomy of an applet. It'll discuss:
- how applets must have an Applet subclass,
- how applets can use other custom classes,
- how applets are loaded,
- how applets are included in HTML files,
- how the "Hello World" applet works,
- how applets don't need a main() method (mentioning how init() and start() are pseudo-substitutes),
- how you don't do stuff in constructors -- wait until init().
- using import.
I'm not sure how far I'll get into Java language stuff. Should we assume the reader has read the anatomy of an application section? If so, we need to take out that little note about "skip to the applet if you're not interested in applications..."
Once Again, the Code
Here again is the code for the "Hello World" applet.. . .import java.awt.Graphics; import java.applet.Applet; public class HelloWorld extends Applet { public void paint(Graphics g) { g.drawString("Hello world!", 50, 25); } }
![]()
The "Hello World" Applet