I want to remove the first line in jtextpane and setting setContentType("text/html") at the same time.
setContentType("text/html");
Element root = getDocument().getDefaultRootElement();
Element firstLine = root.getElement(0);
getDocument().remove(firstLine.getStartOffset(), firstLine.getEndOffset());
When I use setContentType("text/html") in the code it does not remove the first line.