我用下面的一段代码,发现我可以加粗,设置字体大小,改变颜色,但是如果是缩进,或者是行距什么的
却无法实现,我不懂为什么会这样,有知道的人能帮帮忙说一下原因吗?
SimpleAttributeSet attrSet = new SimpleAttributeSet(); 
StyleConstants.setLeftIndent(attrSet, 30); //无法实现缩进
StyleConstants.setBold(attrSet, true);   //可以实现字体加粗
StyleConstants.getLeftIndent(attrSet); //得到值是30
Document doc = msgArea.getDocument();     
try   {   
       doc.insertString(doc.getLength(), "要缩进的字符", attrSet);   
}catch   (BadLocationException   e)   {   
        System.out.println("BadLocationException:   "   +   e);   
}