关于java GUI界面J text Pane控件对字体颜色大小等排版方法
public void style(JTextPane jTextPane){
SimpleAttributeSet aSet = new SimpleAttributeSet();
StyleConstants.setForeground(aSet, Color.blue);
StyleConstants.setBackground(aSet, Color.orange);
StyleConstants.setFontFamily(aSet, "lucida bright italic");
StyleConstants.setFontSize(aSet, 36);
StyleConstants.setAlignment(aSet, StyleConstants.ALIGN_RIGHT);
StyledDocument doc = jTextPane.getStyledDocument();
doc.setCharacterAttributes(105, doc.getLength()-105, aSet, false);
doc.setParagraphAttributes(0, 104, aSet, false);
}
}