I figured out how to read line by line and display the contents of a text document line by line in jtextarea, and I figured out how to write line by line from an array of lines to a text document. Itβs just hard for me to get every row from the text field, as soon as I get each row into an array, I have to go Below is the code I'm going to use to write each line to a file ...
public class FileWrite { public static void FileClear(String FileName) throws IOException{ FileWriter fstream = new FileWriter(FileName,true); BufferedWriter out = new BufferedWriter(fstream); out.write(""); } public static void FileWriters(String FileName, String Content) throws IOException { FileWriter fstream = new FileWriter(FileName,true); BufferedWriter out = new BufferedWriter(fstream); out.append(Content); out.newLine(); } }
thanks
from
source share