// A class that presents a dialog box for outputting values about a person.
// Barry Cornelius, 20 June 2000
import java.awt.event. ActionEvent;
import java.awt.event. ActionListener;
import java.awt.       BorderLayout;
import java.awt.       Component;
import javax.swing.    JButton;
import javax.swing.    JDialog;
import javax.swing.    JFrame;
public class PersonOutputDialog implements ActionListener
{
   private JDialog iJDialog;
   public PersonOutputDialog(final JFrame pJFrame, final Person pPerson,
                             final int pX, final int pY)
   {
      final PersonForm tPersonForm = new PersonForm();
      tPersonForm.setPerson(pPerson);
      final Component tPersonFormGUI = tPersonForm.getGUI();
      final JButton tJButton = new JButton("OK");
      tJButton.addActionListener(this);
      iJDialog = new JDialog(pJFrame, "PersonOutputDialog", true);
      iJDialog.getContentPane().add(tPersonFormGUI, BorderLayout.CENTER);
      iJDialog.getContentPane().add(tJButton,       BorderLayout.SOUTH);
      iJDialog.setLocation(pX, pY);
      iJDialog.pack();
      iJDialog.setVisible(true);
   }
   public void actionPerformed(final ActionEvent pActionEvent)
   {
      iJDialog.setVisible(false);
      iJDialog.dispose();
   }
}
