0006: import java.applet.Applet; // HWLet.java
0007: import java.awt.Graphics;
0008: public class HWLet extends Applet {
0009: public void paint(Graphics rGraphics) {
0010: rGraphics.drawString("Hello World!", 50, 25);
0011: }
0012: }
javac HWLet.javaThis produces a file of bytecodes in the file HWLet.class.
0013: <HTML> 0014: <HEAD> 0015: <TITLE> HWLet example </TITLE> 0016: </HEAD> 0017: <BODY> 0018: Before the output from the applet. 0019: <APPLET CODE="HWLet.class" WIDTH=150 HEIGHT=25> 0020: </APPLET> 0021: After the output from the applet. 0022: </BODY> 0023: </HTML>