class Student { String fName; String lName; int grade; } public class StudentGuiIhsan2 extends JFrame implements ActionListener { //lots of declerations Vector students = new Vector(); public StudentGui2() //CONSTRUCTOR { //lots of assignments //BuTTON ASSIGNMENTS; add an actionlistener! jb_addStudent=new JButton("Add Student"); jb_addStudent.addActionListener(this); jb_addStudent.setActionCommand("add"); jb_editStudent = new JButton ("Edit Student"); jb_editStudent.addActionListener(this); jb_editStudent.setActionCommand("remove"); //lots of panels } public void actionPerformed(ActionEvent evt) { //check if the add button was pressed if (evt.getActionCommand().equals("add")){ addStudent(); } //add a student } public void addStudent(){ Student newStudent=new Student(); newStudent.fName=jt_fName.getText(); //need to get the other values as well students.add(newStudent); //add the new student; to what? writeStudents(); //add new student to the text area studentsOut.append(newStudent.fName); studentsOut.append(", "); //continue this } //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(){ Student student1; try{ PrintWriter outFile=new PrintWriter(new FileWriter(fileName)); for(int i=0;i