Example usage for javax.swing JEditorPane setDisabledTextColor

List of usage examples for javax.swing JEditorPane setDisabledTextColor

Introduction

In this page you can find the example usage for javax.swing JEditorPane setDisabledTextColor.

Prototype

@BeanProperty(preferred = true, description = "color used to render disabled text")
public void setDisabledTextColor(Color c) 

Source Link

Document

Sets the current color used to render the disabled text.

Usage

From source file:net.sf.texprinter.utils.UIUtils.java

/**
 * Format an editor to act as a label. I decided to replace all the
 * occurrences of multiline JLabel's to JEditorPane's instead, so I
 * want them to look exactly like ordinary JLabels.
 * //from  w ww.j  av  a2  s . co m
 * @param editor The editor to be formatted as a label.
 */
public static void formatEditorPaneAsLabel(JEditorPane editor) {

    // disable it
    editor.setEnabled(false);

    // make it read only
    editor.setEditable(false);

    // transparent
    editor.setOpaque(false);

    // set the disabled color as black
    editor.setDisabledTextColor(Color.BLACK);
}