//HelloGUIApp2.java
//An application to display "Hello, world!" in a window, in color.

import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Font;
import java.awt.Color;


public class HelloGUIApp2
{
    public static void main(String[] args)
    {
        GUI2 gui = new GUI2("Hello GUI Application Version 2");
        gui.setSize(500, 100);
        gui.setVisible(true);
    }
}


class GUI2 extends Frame
{
    public GUI2(String s)
    {
        super(s);
        setBackground(Color.yellow); // from Component
    }

    public void paint(Graphics g)
    {
        //Declare the font you want:
        Font font = new Font("SanSerif", Font.BOLD, 18);

        //Set font and color, and then display message
        //on the screen at position (250, 150):
        g.setFont(font);
        g.setColor(Color.blue);
        g.drawString("Hello, world!", 180, 65);
    }
}

