import java.applet.Applet;
import java.awt.*;

// This appears in Core Web Programming from
// Prentice Hall Publishers, and may be freely used
// or adapted. 1997 Marty Hall, hall@apl.jhu.edu.

public class HelloWWW2 extends Applet {
  public void init() {
    setFont(new Font("Helvetica", Font.BOLD, 30));
    String backgroundType = getParameter("BACKGROUND");
    if (backgroundType != null &&
        backgroundType.equals("LIGHT")) {
      setBackground(Color.white);
      setForeground(Color.black);
    } else if (backgroundType != null &&
               backgroundType.equals("DARK")) {
      setBackground(Color.black);
      setForeground(Color.white);
    } else {
      setBackground(Color.gray);
      setForeground(Color.darkGray);
    }
  }

  public void paint(Graphics g) {
    g.drawString("Hello, World Wide Web.", 5, 35);
  }
} 

