In an every article the answer to a question \"How to append a string to a JEditorPane?\" is something like
jep.setText(jep.getText + \"new string\");
setText is to set all text in a textpane. Use the StyledDocument interface to append, remove, ans so on text.
txtPane.getStyledDocument().insertString( offsetWhereYouWant, "text you want", attributesYouHope);