JEditorPane editor = getEditor(event); StyledDocument doc = getStyledDocument(editor); Element el = doc.getCharacterElement(editor.getSelectionStart()); boolean isUnderline = StyleConstants.isUnderline(el.getAttributes()); SimpleAttributeSet atts = new SimpleAttributeSet(); StyleConstants.setUnderline(atts, ! isUnderline); setCharacterAttributes(editor, atts, false);
    public void actionPerformed(ActionEvent event)    {			// TODO    }