print toString to .txt file
Hey I am trying to print an entire toString method + default header to a .txt file . I also want to make the name of the file a variable which changes(A persons name).
I currently have a GUI made that displays the text in a JTextArea(after calculations are made which are also dynamic). I want to add some text(sort of like a header) to the toString and then concatenate all text from the JTextArea after and print that information to a .txt file using a String which represents that persons name. The printing to the text file would happen when a button is clicked and after a file is written, the information could be changed to write many more new files if need.
Please help with some suggestions.