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

        // Paint a string in the graphics context of an Applet.
public class HelloApplet extends Applet {
        // Override Applet's paint method.
    public void paint(Graphics g){
        // Define the drawing position.
        final int xpos = 10, ypos = 50;
        // Clear the background.
        setBackground(Color.white);
        final Dimension size = getSize();
        g.clearRect(0,0,size.width,size.height);

        g.drawString("Welcome to Earth!",xpos,ypos);
    }
}
