使用例如
HTMLdocument doc=(HTMLdocument) textPane.getStyleddocument();doc.insertAfterEnd(doc.getCharacterElement(doc.getLength()),"<b>Goodbye!</b>");
要么
HTMLEditorKit kit=(HTMLEditorKit )textPane.getEditorKit();
如果要插入段落/表格或其他分支元素,则使用该方法
public void insertHTML(HTMLdocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag insertTag)



