Hi everyone,
I was wondering if there is an efficient or fast or preferred way to
open text files in java. I want to load the text file into a JTextPane.
The way I do it now is...
.....
BufferedReader objBrIn = new BufferedReader( new FileReader(this .file));
String strTemp;
String strOut = "";
try {
while ((strTemp = objBrIn.readLin e()) != null) {
strOut += (strTemp + newline);
}
objTextPane.set Text(strOut);
.....
but that takes forever to open and display even moderately large text files.
Does anyone know a better way to do this?
Thanx,
Tony G.
I was wondering if there is an efficient or fast or preferred way to
open text files in java. I want to load the text file into a JTextPane.
The way I do it now is...
.....
BufferedReader objBrIn = new BufferedReader( new FileReader(this .file));
String strTemp;
String strOut = "";
try {
while ((strTemp = objBrIn.readLin e()) != null) {
strOut += (strTemp + newline);
}
objTextPane.set Text(strOut);
.....
but that takes forever to open and display even moderately large text files.
Does anyone know a better way to do this?
Thanx,
Tony G.
Comment