java - Line-Spacing in JTextArea -
It seems that my current JTextArea example is about 1 or 1.5 lining. Can anyone tell me how to change line-spacing in JTextArea example?
Performing a Google search gives you a suggestion JTextPane
and especially You should use the setParagraphAttributes
located.
The way you get AttributeSet
is as follows:
MutableAttributeSet set = New SimpleAttributeSet (); StyleConstants.setLineSpacing (set, / * your spacing * /);
Now just pass in the set
setParagraphAttributes method.
Hope it helps.
Comments
Post a Comment