I'm trying to load an HTML file that is large approximately 2MB (1927KB for the sake of precision) into a JEditorPane, and it takes about 65 seconds, it seems to be a bug of the JTextPane/JEditorPane, i have read also several articles on the web like this one, but i couldn't find a solution ...
Here's the code that i use :
final String htmlContent = //Load a 2MB String
previewPane.setContentType("text/html; charset=UTF-8");
previewPane.setText(htmlContent);
The setText method takes about 65seconds to get completely executed as you can see in my application log :
Set the html content(1927KB) of the Preview pane, loading time=68230ms
Set the html content(1927KB) of the Preview pane, loading time=62693ms
Set the html content(1927KB) of the Preview pane, loading time=66583ms
Is there a way to solve this problem ?
About 65 seconds to load 2MB of Text is a terrible performance on an Intel Core 2 Duo 2.93GHz with 8GB of DDR 3 RAM ...
May be some of the tricks help http://java-sl.com/JEditorPanePerformance.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With