1 | import java.awt.Graphics; |
2 | public class HelloApplet extends java.applet.Applet |
3 | { public void paint (Graphics g) |
4 | { g.drawString("Hello World!", 5, 25); |
5 | } |
6 | } |
7 | The import statement allows the use of Graphics methods |
8 | The paint method uses graphics methods like drawString to draw objects on the window |
9 | You name the applet here. |
10 | The applet is a program with methods, like paint, that are called by the browser to draw in the window. This applet displays the string "Hello World!" |