Example usage for javax.swing JTextArea setSelectionColor

List of usage examples for javax.swing JTextArea setSelectionColor

Introduction

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

Prototype

@BeanProperty(preferred = true, description = "color used to render selection background")
public void setSelectionColor(Color c) 

Source Link

Document

Sets the current color used to render the selection.

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);
    ;/*w  w  w . j  av  a 2  s . c om*/

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