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