Hi i'm really new to this world and i was just wondering on how i could save the content of my jTextArea1 that the next time i open my app, the words that i have typed will be in the text area and the text area won't be empty. What i mean is that i want the textarea to remember all content that is typed inside it because the next time i open the app the content will be inside it and the text area won't be empty. Thanks anyway.

gbp1998

An image to understand better.

有帮助吗?

解决方案

Try something like this then to store in a text file:

PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("area1.txt")));
out.write( jTextArea1.getText() );
out.close();
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top