inserting HTML with Editorkit does nothing!
Hi.
Please have a look at the following code-snippet:// jtpMain is a JTextPane containing some text
HTMLEditorKit htmlKit =new HTMLEditorKit();
HTMLDocument htmlDoc = (HTMLDocument) jtpMain.getStyledDocument();
jtpMain.setEditorKit(htmlKit);
String t = htmlDoc.getText(0, htmlDoc.getLength());
System.out.println("styled doc contains:" + t);
htmlKit.insertHTML(
htmlDoc,
jtpMain.getCaretPosition(),
"<b>Hello World!</b>",
0, 0,
HTML.Tag.B
);
System.out.println("html inserted.");
I get both the messages (System.out.println) and no Exception is thrown. But this should insert the bold String 'Hello World!' into the existing document. Anyhow there's no result. The text is still the same as before, nothing has changed. Does anyone know why?
cheers,
kelysar

