Originally Posted by
cardamis
Hey guys so here is my problem,i have a text file that i want it to be shown in a textarea here is the code i am using,the problem is that it doesnt read the whole file,it reads only the first line any help appreciated.
Replace the following line:
jTextArea1.setText(text);
with the following :
System.out.println(text);
If you see your file completely ( not only the first line ), then something wrong with your JTextArea, otherwise, if your println shows the same as
the JTextArea, most likely something is not quite right with reading the file, maybe u don't have Return carriages at the end of each line in the file2.txt.