/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package guitest; import javax.swing.*; //import javax.swing.JOptionPane; import java.awt.FlowLayout; /** * * @author jcmtiernan */ public class GUITest { /** * @param args the command line arguments */ public static void main(String[] args) throws InterruptedException { JFrame inFrame = new JFrame(); JTextArea iFArea = new JTextArea(); PersonInfo person1 = new PersonInfo(); GUIone inPanel = new GUIone(person1); JLabel nm; inFrame.add(inPanel); inFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); inFrame.setSize(600,300 ); inFrame.setVisible(true); /* String firstNumber = JOptionPane.showInputDialog("Enter a number"); int number1 = Integer.parseInt(firstNumber); JOptionPane.showMessageDialog(null,"The value was"+number1, "Entered Value", JOptionPane.PLAIN_MESSAGE); */ //checkPrint(inPanel); //nm = new JLabel(inPanel.getFirstNm()+" "+inPanel.getLastNm()); //inFrame.add(nm); for (int counter = 0; counter < 40; counter++) { Thread.sleep(1000); checkPrint(person1); } //name.concat(inPanel.getFirstNm()+" "+inPanel.getLastNm()); //birthmonth = inPanel.getBirthMo(); //System.out.println(name+" was born in the "+birthmonth+" month"); //System.out.println("You typed in "+ inPanel.getFirstNm()); //iFArea.setText("You typed in "+ inPanel.getFirstNm()); //inFrame.add(iFArea); } public static void checkPrint(PersonInfo person1) { Integer birthmonth; birthmonth = person1.getBirthMo(); String name = new String(person1.getFirstNm()+" "+person1.getLastNm()); System.out.println(name+" was born in the "+birthmonth+" month"); } }