1

I know that I can set the font size on a javax.swing.text.DefaultStyledDocument like this:

public void apply(DefaultStyledDocument document) {
    final MutableAttributeSet attributeSet = new SimpleAttributeSet();
    StyleConstants.setFontSize(attributeSet, 12);
    document.setCharacterAttributes(0, 80, attributeSet, false);
}

How do I set the font color?

Paul Reiners
  • 8,576
  • 33
  • 117
  • 202

1 Answers1

1

I would guess you use the StyleConstants.setForeground(...) method.

camickr
  • 321,443
  • 19
  • 166
  • 288