import java.awt.*; import java.applet.*; public class FontApplet extends Applet { public void paint(Graphics g) { Font font = new Font("Arial",Font.BOLD,30); g.setFont(font); FontMetrics fm = g.getFontMetrics(); g.setColor(Color.BLACK); // first set y to the first line that will be on-screen int y = fm.getHeight(); // draw a line of text there g.drawString("Hello World",10,y); } }