I am a beginner at Java and I have problems with GUI assignment.
My assignment is to make GUI to calculate orders and to save the calculation to .csv file.
I have solved "save" button and it really does save my input to .csv file.
But, my problem is "Load button" When I press it, how to load .csv file to my existing JTextFields?
Bellow is the picture.
Do you have problem with loading csv file or mapping it with text fields.
Could you show your load method?
Thank you for quick response!
Well, the problem is mapping it with text fields. I don't know how to read the file and implement it to my textfields.
To be more precise, lower row (load , prev,next )of my JButtons doesn't work, above row (calculate,save,clear,exit) works fine.
Assuming that your file has multiple entries (lines) you also have to determine what concrete entry you want to display in text fields.
For loading file I would go with BufferReader and then read line by line (even separate string from one line) and store it in the list of Strings.
You can then easily iterate the list for data you want to display. Adding that data to text fields would not be so hard then.