Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. public void saveToFile() {
  2. String filename = gt.getFilePath();
  3. BufferedWriter bw;
  4. try {
  5. bw = new BufferedWriter(new FileWriter(filename));
  6. bw.write(this.gt.getTextFromEntry(0));
  7. bw.close();
  8. } catch (Exception e) {
  9. e.printStackTrace();
  10. }
  11. String firstName = (String) this.gt.getTextFromEntry(1);
  12. String surname = (String) this.gt.getTextFromEntry(2);
  13. String email = (String) this.gt.getTextFromEntry(3);
  14. String cont = (String) this.gt.getTextFromEntry(4);
  15. String patientNo = (String) this.gt.getTextFromEntry(5);
  16. String date = (String) this.gt.getTextFromEntry(6);
  17. String doctor = (String) this.gt.getTextFromEntry(7);
  18. String fileNo = (String) this.gt.getTextFromEntry(8);
  19. int contact = Integer.parseInt(cont);
  20. int patientNumber = Integer.parseInt(patientNo);
  21. int file = Integer.parseInt(fileNo);
  22. Patients[file] = new Patient(firstName, surname, email, contact);
  23. Sessions[file] = new Session(patientNumber, date, doctor, file);
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement