Example usage for javax.swing.text.html HTMLEditorKit.ItalicAction HTMLEditorKit.ItalicAction

List of usage examples for javax.swing.text.html HTMLEditorKit.ItalicAction HTMLEditorKit.ItalicAction

Introduction

In this page you can find the example usage for javax.swing.text.html HTMLEditorKit.ItalicAction HTMLEditorKit.ItalicAction.

Prototype

HTMLEditorKit.ItalicAction

Source Link

Usage

From source file:net.java.sip.communicator.impl.gui.main.chat.ChatWritePanel.java

/**
 * Enables the italic style/*from  w ww .j a  v  a  2s.c o  m*/
 * @param b TRUE enable - FALSE disable
 */
public void setItalicStyleEnable(boolean b) {
    StyledEditorKit editorKit = (StyledEditorKit) editorPane.getEditorKit();
    MutableAttributeSet attr = editorKit.getInputAttributes();

    if (b && !StyleConstants.isItalic(attr)) {
        setStyleConstant(new HTMLEditorKit.ItalicAction(), StyleConstants.Italic);
    }
}