Memory « JEditorPane « Java Swing Q&A





1. JEditorPane and Memory Usage    forums.oracle.com

// Create the JEditorPane, setting the content-type and the HTML text jepEditorPane = new JEditorPane("text/html", this.strHTML); jepEditorPane.setEditable(false); jspScrollPane = new JScrollPane(jepEditorPane); // Line with memory issue jfrMainFrame.getContentPane().add(jspScrollPane); jspScrollPane.getViewport().add(jepEditorPane); jfrMainFrame.setSize(intWidth, intHeight); jfrMainFrame.setTitle(strHTML.substring(strHTML.indexOf("") + 7, strHTML.indexOf(""))); jfrMainFrame.setVisible(true); jfrMainFrame.setEnabled(true); } The HTML to be viewed is contained in the this.strHTML String variable. When that variable contains something of limited size (perhaps 100 lines of ...