I have the same problem - probably because I am also populating the text area using the append method. Here is my code:
private void getData(String file){
String log = file;
String line = "";
try{
reader = new FileReader("c:\\STB_Code\\" + log);
in = new BufferedReader(reader);
while( (line = in.readLine()) != null) {
//write the line to the display area
logDisplay.append(line + "\n");
}//while
}//try
//process exceptions from opening the file and reading lines
catch(FileNotFoundException filenotfoundException) {
JOptionPane.showMessageDialog(this, "File Not Found",
"Error", JOptionPane.ERROR_MESSAGE);
}//catch
catch(IOException ioEx) {
JOptionPane.showMessageDialog(this, "Error Reading Line",
"Error", JOptionPane.ERROR_MESSAGE);
ioEx.getMessage();
}
//Close the file
try {
reader.close();
in.close();
}
catch(IOException ioEx) {
JOptionPane.showMessageDialog(this, "Error Closing File",
"Error", JOptionPane.ERROR_MESSAGE);
ioEx.getMessage();
}
}//end getData
Did you solve this problem? If so could you please share?
Thanks,
Mike