need a better way of displaying a text file in a jscrollpane
hello
i have a signed applet which reads a very large text file (25mb) from a urlConnection and copies all the text into a file local on the users machine. dont worry about security issues. this is an internal thing for work.
this part is fine. takes only a couple of seconds.
the problem is when i am opening this local file and attempting to output the contents line by line to a scrollable window. it works, but it takes ages. there are about 250,000 lines in the text file and it takes in the region of 15+ minutes!
here is the snippet of my code which is outputting to a scrollable window :
File f =new File("C:\\test_copy.txt");
BufferedReader br;
FileReader fr;
String line;
fr =new FileReader(f);
br =new BufferedReader(fr);
JTextArea data =new JTextArea("", 20,150);
data.setFont(new Font("Courier", Font.PLAIN, 10));
data.setEditable(false);
while ((line = br.readLine()) !=null){
System.out.println(line);
data.append(line);
}
JScrollPane dataWindow =new JScrollPane(data);
this.add(dataWindow);
System.out.println("complete");
is there a more efficient way i can achieve what im trying to do? if so, could anyone point me the correct way to do so?
thanks in advance.

