This code may solve your question.
// make it read-only
editorPane.setEditable(false);
// add an html editor kit
HTMLEditorKit htmlkit = new HTMLEditorKit();
HTMLDocument htmlDoc = (HTMLDocument) htmlkit.createDefaultDocument();
editorPane.setEditorKit(htmlkit);
String htmlString = "<html><body>In the given figure, ABCD is a quadrilateral in which BD = 10 cm, AL <SPAN>^</SPAN> BD, CM <SPAN style=\\\"FONT-FAMILY:Symbol\\\">^</SPAN> BD such that AL = 4 cm and CM = 6 cm. Find the area of quadrilateral ABCD.<BR><IMG align=middle </body></html>";
Reader htmlStringReader = new StringReader(htmlString);
try {
htmlkit.read(htmlStringReader, htmlDoc, 0);
} catch (IOException e1) {
// TODO Auto-generated catch block
System.out.println(e1.getMessage());
e1.printStackTrace();
} catch (BadLocationException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
editorPane.setEditorKit(htmlkit);
htmlDoc.putProperty("ZOOM_FACTOR", new Double(0.5));
editorPane.setDocument(htmlDoc);
Best regards,
Pedro Azzam.