// A program that uses a PersonForm to display the details about a person.
// Barry Cornelius, 19 June 2000
import java.awt.    BorderLayout;
import java.io.     BufferedReader;
import java.awt.    Component;
import java.awt.    Container;
import java.io.     InputStreamReader;
import java.io.     IOException;
import javax.swing. JFrame;
public class PersonOutputProg
{
   public static void main(final String[] pArgs) throws IOException
   {
      final PersonForm tPersonForm = new PersonForm();
      final Component tPersonFormGUI = tPersonForm.getGUI();
      final JFrame tJFrame = new JFrame("PersonOutputProg");
      final Container tContentPane = tJFrame.getContentPane();
      tContentPane.add(tPersonFormGUI, BorderLayout.CENTER);
      final ExitWindowListener tExitWindowListener = new ExitWindowListener();
      tJFrame.addWindowListener(tExitWindowListener);
      tJFrame.pack();
      tJFrame.setVisible(true);
      final BufferedReader tKeyboard =
                    new BufferedReader(new InputStreamReader(System.in));
      System.out.println("Type in a person using the format " +
                         "Name%DateOfBirth%PhoneNumber%Height");
      final String tLine = tKeyboard.readLine();
      final Person tPerson = new PersonImpl(tLine);
      System.out.println("The person is: " + tPerson);
      tPersonForm.setPerson(tPerson);
   }
}
