I have made 2 classes; Customer and Repair.
I have a map<String, Customer>(customerDetails). Customer objects hold a map<String, Repair>(repairs).
My GUI has 2 JTextAreas, notes and results.
In notes ou type some notes and when you choose save the notes appear in results and a new Repair is created with the notes as an attribute and added to repair map for the chosen Customer
I have a method processEditRepair() that when a string that matches a key in map repair is entered the the notes of that Repair object appear in the GUI notes JTextArea for editing. How would I go about saving these notes to ther same Repair object, overwriting the old notes?
Here is my processEditRepair() method
private void processEditRepair()
{
String ref = gui.refText.getText().toUpperCase();
Customer cus;
readFile();
if(ref.length() == 6)
{
cus = getCustomerRepair();
notesString = cus.repairs.get(ref).getNotes();
gui.nameText.setText(cus.getName());
gui.notes.setText(notesString);
}
}
Thanks for looking.