import java.awt.*;

        // Paint a string in the graphics context of a Frame.
public class AWTWorld {
    public static void main(String[] args){
        HelloWorld world = new HelloWorld();
        world.setVisible(true);
    }
}

        // Extend Frame to provide control over the frame's contents.
class HelloWorld extends Frame {
    public HelloWorld(){
        // Give this frame a title.
        super("Hello World");
        // Set the frame's size.
        final int width = 150, height = 100;
        setSize(width,height);
        setBackground(Color.white);
    }

        // Override Frame's paint method.
    public void paint(Graphics g){
        // Define the drawing position.
        final int xpos = 10, ypos = 50;
        g.drawString("Welcome to Earth!",xpos,ypos);
    }
}
