Example usage for javax.swing JTextArea setCaretColor

List of usage examples for javax.swing JTextArea setCaretColor

Introduction

In this page you can find the example usage for javax.swing JTextArea setCaretColor.

Prototype

@BeanProperty(preferred = true, description = "the color used to render the caret")
public void setCaretColor(Color c) 

Source Link

Document

Sets the current color used to render the caret.

Usage

From source file:com.mindcognition.mindraider.ui.swing.concept.annotation.renderer.AbstractTextAnnotationRenderer.java

private void configureEditor(JTextArea annotationTextArea) {
    // TODO use colors from the configuration
    annotationTextArea.setForeground(Color.WHITE);
    annotationTextArea.setBackground(Color.BLACK);
    annotationTextArea.setCaretColor(Color.RED);
    annotationTextArea.setSelectionColor(Color.YELLOW);
    annotationTextArea.setLineWrap(true);
    annotationTextArea.setWrapStyleWord(true);
    annotationTextArea.setFont(TEXTAREA_FONT);
    ;/*from   w ww .ja  v a 2  s  .c o  m*/

    // undo and redo
    undoManager = new UndoManager();
    annotationTextArea.getDocument().addUndoableEditListener(new EditorUndoListner(undoManager, toolbar));
}