posted 8 years ago
I have 2 jPanels: Data1 and Data2. These jPanels contains jTextFields and jComboBoxes. The purpose of program to input data to jTextFields and save it in text file.
Every jPanel have a saveButton. When the saveButton1 of Data1 jPanel is hit it will save in Data1.txt file.
When saveButton2 of Data2 is pressed it will save to Data2.txt file.
Fot this moment, I can get data from jTextFields and save them to Data1.txt and Data2.txt files.
The contents of Data1.txt file is: Name, Affiliation, Phone;
Data2.txt file is: Birth, Address, Title.
The question is: how can I get inputted value of Data2 jPanel and save it to Data1.txt file?
For example, when the saveButton2 of Data2 is pressed, then the value of "Address" must appear in Data1.txt file after "Affiliation", i.e. Data1.txt->Name, Affiliation, Address, Phone.
Thank you for help.