class EditStudentFrame extends JFrame implements ActionListener{ int recordNumber; JLabel jl_fname// what other Jlabels? JTextField jt_fname//what other jTextFields? JButton jb_edit; StudentGui2 mainFrame; Vector students; int studentNumberToEdit; EditStudentFrame(Vector studentsIn, int studentNumberToEdit, StudentGui2 mnFrame){ students=studentsIn; recordNumber=studentNumberToEdit; student1=(Student)students.get(recordNumber); mainFrame=mnFrame; //get reference to the main JFrame, so we can update the JTextArea and write out the vector getContentPane().setLayout(new BoxLayout(getContentPane(),BoxLayout.Y_AXIS)); jl_fname=new JLabel("First Name: "); //what else? jt_fname=new JTextField(10); //what else? //put in current values jt_fname.setText(student1.fName); //what else? jb_edit=new JButton("Edit"); jb_edit.addActionListener(this);//don't need to set command, because this is the only button in this Frame! getContentPane().add(jl_fname); //what else do you need to add? setSize(400,400);//try pack() instead setVisible(true); } public void actionPerformed(ActionEvent evt) { //only one button, so we don't need to check which one was pressed //could do the work below in another method Student student1=new Student(); //put updated info in an object of type Student student1.fName=jt_fname.getText(); //what else? //replace the old student with the edited student in the vector list students.set(recordNumber,student1); //set() replaces the element at the record number mainFrame.writeStudents(); //write out the updated file mainFrame.writeTextArea(); this.setVisible(false); //getting rid of edit window, there must be a better way to do this, if you find it, let me know! } } public class StudentGui2 extends JFrame implements ActionListener { //lots of code removed public void editStudent(){ String studentToEdit; Student student1=new Student(); int i=0; //index, initialized to zero EditStudentFrame editStudent1; //this is a pop up frame for editing students studentToEdit=jt_editStudentName.getText(); student1=(Student)students.get(i); while(true){ if (student1.fName.equals(studentToEdit)) break; //break out of this loop, otherwise, check next student i++; student1=(Student)students.get(i); } editStudent1= new EditStudentFrame(students, i, this);// students is the vector of Students; i is the number of the student to edit //'this' is a reference to the current JFrame, so we can call some methods from the other class } //note that it is very inefficient to write the entire file each time you add a student. How could you be more effient? public void writeStudents(){ //how are you going to write the student file? } public void writeTextArea(){ //need to rewrite the text area }