TextArea, TextPane and EditorPane

Swing components: JTextArea, JTextPane and JEditorPane
Swing tutorial: How to Use Text Areas and How to Use Editor Panes and Text Panes

Following documentation describes TextArea, but TextPane and EditorPane have same properties. Replace TextArea. with TextPane. or EditorPane. for those components.

Properties

TextArea Properties

Colors

UI Key Style Key v2 Description
TextArea.foreground foreground text color if enabled (also used if not editable)
TextArea.inactiveForeground disabledTextColor text color if disabled
TextArea.background background background color if enabled
TextArea.inactiveBackground inactiveBackground background color if not editable, but enabled
TextArea.disabledBackground disabledBackground background color if disabled
TextArea.focusedBackground focusedBackground background color if focused (optional)
TextArea.selectionForeground selectedTextColor selected text color
TextArea.selectionBackground selectionColor background color of selected text
TextArea.caretForeground caretColor (blinking) caret color

Sizes

UI Key Style Key v2 Type Description
TextArea.margin margin Insets margin space between the component border and the text
Component.minimumWidth minimumWidth int minimum width of component (in pixels)

Other

UI Key Style Key v2 Type Description
TextArea.font font Font font used to render text
TextArea.border border Border usually a FlatMarginBorder
TextArea.caretBlinkRate - int blink rate of the caret (in milliseconds)