Basically I have a file called FlowLayout.html and I want to read it into the JEditorPane. I have all the code up to that point but I don’t know how to open the file in the pane.
JEditorPane jtfInfo = new JEditorPane();
jtfInfo.setEditable(false);
p3.add(jtfInfo);
public void getFlowLayout(){
jftInfo.setContentType("text/html");
//I dont know this step and setContentType gives me an error in netbeans Cannot find symbol
}
You can just call the
setPage()method with URL pointing at the FlowLayout.html file:From the Java Tutorial: How to Use Editor Panes and Text Panes: