I have created the following to code to display a file contents to a text area - and it is successful:
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader("C:\\Users\\emily\\Documents\\Parts.txt"));
String str;
while ((str = in.readLine()) != null) {
jTextArea1.append("\n"+str);
}
} catch (IOException e) {
} finally {
try { in.close(); } catch (Exception ex) { }
}
My problem is that I need each line in an array. The idea for my proof of concept is that I would be able to enter the command :
jTextArea1 = Arrays.toString(fileArray);
In spite of my scouring of the internet, I can't seem to accomplish this. Can anyone tell me how to load these values into an Array (fileArray) instead of writing them into the jTextArea?