CodeEditorDefaults defaults = new CodeEditorDefaults(); defaults.setStyle(Token.KEYWORD1, Color.BLUE, false, true); defaults.setStyle(Token.KEYWORD2, Color.BLUE, false, true); defaults.setStyle(Token.KEYWORD3, Color.BLUE, false, true); defaults.setStyle(Token.COMMENT1, Color.DARK_GRAY, false, false); defaults.setStyle(Token.COMMENT2, Color.DARK_GRAY, false, false); defaults.eolMarkers = false; defaults.paintInvalid = false; // create CodeEditor JEditor ta = new JEditor(defaults);
| Field | Usage |
|---|---|
editable |
Specifies if the editor is editable (default is true) |
cols |
The number of columns of the editor |
rows |
The number of rows of the editor |
tabSize |
The tabulation size |
font |
The font of the editor |
eolMarkerColor |
The color of the end of lines markers |
eolMarkers |
Specifies if line markers are shown (default is true). End of line markers are "." characters |
paintInvalid |
Specifies if empty lines are painted with a "~" character (default is true) |
| Field | Usage |
|---|---|
caretVisible |
Specifies if the caret is visible (default is true) |
caretBlinks |
Specifies if the caret is blinking (default is true) |
caretColor |
The color of the caret |
| Field | Usage |
|---|---|
selectionColor |
The color of text selection |
lineHighlightColor |
The color of line selection selection |
lineHighlight |
Specifies if line highlight is allowed (default is true) |
bracketHighlightColor |
The color of brackets selection highlight |
bracketHighlight |
Specifies if brackets highlight is allowed (default is true) |
| Field | Usage |
|---|---|
hasPopup |
Specifies if there is a popup which should appear for right-clicking in the editor area (default is false) |
popup |
The Popup menu in the editor when right-clicking on the editor (default is null, tehre is no popup by default) |
| Field | Usage |
|---|---|
gutterCollapsed |
Specifies if the gutter is initially copllapsed (default is true) |
gutterExpandable |
Specifies if the gutter can be expanded (if collapsed) or collapsed (if expanded) (default is true) |
gutterWidth |
The gutter width when it is expanded (default is 40 pixels) |
gutterBgColor |
The gutter background color (default is white) |
gutterFgColor |
The gutter foreground color (default is black) |
gutterHighlightColor |
The gutter highlight color (default is Magenta) |
gutterBorderColor |
The gutter border color (default is Gray) |
gutterBorderWidth |
The gutter border width (default is 4 pixels) |
gutterNumberAlignment |
The gutter number alignment (default is RIGHT) |
gutterFont |
The gutter font (default is Monospaced) |
gutterCollapsed, gutterExpandable, gutterFgColor, gutterBorderWidth, gutterBorderColor, gutterBgColor, and gutterHighlightColor fields are set. The addGutter() method will put their default valuesCopyright 2016-2019 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence