Append to JEditorPane
843805Dec 6 2005 — edited Dec 8 2005As I know JEditorPane doesn't have option of append like JTextArea.
So I wrote this code:
/*--------------------------------------------------------------------------------*/
JEditorPane jp = getJep();
String str = "";
StringBuffer buff=new StringBuffer();
// FileReader -Class reading from file by using
// FileReader and BufferedReader
MyFileReader fi = new MyFileReader(getPass());
if (fi == null)
return;
while ((str = fi.Read()) != null)
{
buff.append(str+Util.getEOL());
}
jp.setText(buff.toString());
fi.CloseFile();
/*--------------------------------------------------------------------------------*/
But hte problem is it working very slowly with large files
How can I improve the speed of the code?