if (event.getActionCommand()=="Write")
//assign empty value to info string variable
writeFile = "";
//start try block
try{
// Set up the output file stream
PrintWriter outFile = new PrintWriter(new PrintStream(new File("GradeReport.txt")));
// Print a header to the output file
outFile.printf("Student Test1 Test2 Test3 Test4 Test5 Average Grade%n");
// for each value in the gradeList arraylist, add the sorted student data (first name, last name, grade) to the info string variable with separated value.
for(int c = 0; c < 15; c++)
{
outFile.printf("%s%t", gradeList.add(fname);
for(int s = 0; s < 5; s++)
{
outFile.printf("%5d%t", gradeList.add(assn);
}
outFile.printf("%7.2f%t", gradeList.add(avg);
outFile.printf("%5c%n", gradeList.add(grade);
}
I'm pretty sure I'm not even close but I am getting add errors in the add method.