public void load() { Stage primaryStage = new Stage(); try { start(primaryStage); } catch (Exception e) { e.printStackTrace(); } }
public void save() { ObservableList<StudentRecord> records = DataSource.getAllMarks(new File(currentFileName)); try { FileWriter writer = new FileWriter(new File(currentFileName)); for (StudentRecord student : records) { writer.append(student.getID()); writer.append(","); writer.append(String.valueOf(student.getAssign())); writer.append(","); writer.append(String.valueOf(student.getMidterm())); writer.append(','); writer.append(String.valueOf(student.getFinal())); writer.append(","); writer.append(student.getGrade()); writer.append("\n"); } } catch (Exception e) { e.printStackTrace(); } }