java - How to set the line spacing in a JtextPane? -
first of all, set jtextpane this:
htmleditorkit editorkit = new htmleditorkit(); htmldocument document = (htmldocument) editorkit.createdefaultdocument(); jtextpane textpane = new jtextpane(); textpane.setcontenttype("text/html"); textpane.setdocument(document);
and want set line spacing in jtextpane , idea,but can't work:
simpleattributeset aset = new simpleattributeset(); styleconstants.setlinespacing(aset, 50); textpane.setparagraphattributes(aset, false);
i wrong?
when call textpane.setparagraphattributes(aset, false);
tries apply line spacing selection nothing selected
call way
document.setparagraphattributes(0, document.getlength(), attr, replace);
Comments
Post a Comment