سؤال

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