I'm making a GUI that has the user input a student's information into the GUI and then I write the information to a file.
My problem is that the program doesn't seem to wait for the user to enter the information to continue the program....it just keeps executing the program, and then by the time the user enters the info the rest of the program has been executed.
Here's my code:
public static void main(String[] args) { StudentData frame = new StudentData(); RandomAccessFile raf = null; raf = frame.receiveFile(); frame.enterStudentData(); frame.setTitle("Student Data"); frame.setSize(1000,650); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setVisible(true); System.out.println("And the fname = " + frame.fname); frame.outputStudentData(raf); }