import java.applet.*; // find Applet class import java.awt.*; // find Graphics class /* A class with the first Java applet */ public class HelloApplet extends Applet { private Font font; /* hook to initialize the applet */ public void init () { font = new Font("Serif", Font.BOLD, 30); } /* redraw the Applet */ public void paint (Graphics g) { this.setBackground(Color.gray); g.setFont(font); g.drawString("Hello, World!", 30, 50); } }