Here you can find the source of getParagraphStyle(SimpleAttributeSet attrSet, int align, float firstLineIndent, float leftIndent, float rightIndent, float lineSpace, float spaceAbove, float spaceBelow, TabSet tabs)
public static SimpleAttributeSet getParagraphStyle(SimpleAttributeSet attrSet, int align, float firstLineIndent, float leftIndent, float rightIndent, float lineSpace, float spaceAbove, float spaceBelow, TabSet tabs)
//package com.java2s; //License from project: LGPL import javax.swing.text.SimpleAttributeSet; import javax.swing.text.StyleConstants; import javax.swing.text.TabSet; public class Main { public static SimpleAttributeSet getParagraphStyle(SimpleAttributeSet attrSet, int align, float firstLineIndent, float leftIndent, float rightIndent, float lineSpace, float spaceAbove, float spaceBelow, TabSet tabs) { if (attrSet == null) { attrSet = new SimpleAttributeSet(); }//from w ww. j a v a 2 s . co m if (align >= 0) StyleConstants.setAlignment(attrSet, align); if (firstLineIndent >= 0) StyleConstants.setFirstLineIndent(attrSet, firstLineIndent); if (leftIndent >= 0) StyleConstants.setLeftIndent(attrSet, leftIndent); if (rightIndent >= 0) StyleConstants.setRightIndent(attrSet, rightIndent); if (lineSpace >= 0) StyleConstants.setLineSpacing(attrSet, lineSpace); if (spaceAbove >= 0) StyleConstants.setSpaceAbove(attrSet, spaceAbove); if (spaceBelow >= 0) StyleConstants.setSpaceBelow(attrSet, spaceBelow); if (tabs != null) StyleConstants.setTabSet(attrSet, tabs); return attrSet; } }