import java.awt.*;

import javax.swing.*;

 

/**

*

 * @author  helenl

 */

public class Gui extends javax.swing.JFrame {

 private JTextField txtField;  

 private JButton plainButton;

    /** Creates new form Gui */

    public Gui() {

        super ("Gives GUI a Title");

        this.setLocation(100, 100);

        this.setSize(400, 600);

       

        Container container = getContentPane();

        container.setLayout (new FlowLayout());

        container.setBackground(Color.red);

  

        txtField =new JTextField(10);

        txtField.setForeground(Color.pink);

        txtField.setText(" Hello World");

        container.add(txtField);

       

        plainButton =new JButton("Plain Button");

        container.add(plainButton);

       

        ButtonHandler handler = new ButtonHandler();

        plainButton.addActionListener(handler);

       

      

     

        this.setVisible(true);

        initComponents();

      

    }

   

    public static void main(String args[]) {

        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {

                new Gui().setVisible(true);

                   }

        });

    }

   

}