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

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

Introduction

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

Prototype

HTMLEditorKit.UnderlineAction

Source Link

Usage

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

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

    if (b && !StyleConstants.isUnderline(attr)) {
        setStyleConstant(new HTMLEditorKit.UnderlineAction(), StyleConstants.Underline);
    }
}