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

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -