Example usage for javax.swing JTextPane getEditorKit

List of usage examples for javax.swing JTextPane getEditorKit

Introduction

In this page you can find the example usage for javax.swing JTextPane getEditorKit.

Prototype

public EditorKit getEditorKit() 

Source Link

Document

Fetches the currently installed kit for handling content.

Usage

From source file:net.sf.jabref.gui.mergeentries.MergeEntries.java

private JTextPane getStyledTextPane() {
    JTextPane pane = new JTextPane();
    pane.setContentType(CONTENT_TYPE);/*from w  w  w.  j a v a  2  s . com*/
    StyleSheet sheet = ((HTMLEditorKit) pane.getEditorKit()).getStyleSheet();
    sheet.addRule(BODY_STYLE);
    sheet.addRule(ADDITION_STYLE);
    sheet.addRule(REMOVAL_STYLE);
    sheet.addRule(CHANGE_STYLE);
    pane.setEditable(false);
    return pane;
}