int len = jTextPane1.getText().length();
jTextPane1.setCaretPosition(len); // place caret at the end (with no selection)
jTextPane1.setCharacterAttributes(aset, false);
jTextPane1.replaceSelection(s + "\n"); // there is no selection, so inserts at caret