StyleConstants.setStrikeThrough(attrs, true);
StyleConstants.setAlignment(attrs, StyleConstants.ALIGN_CENTER);
textPane.getStyledDocument().setParagraphAttributes(paragraph.getStartOffset(),
paragraph.getEndOffset() - paragraph.getStartOffset(), attrs, true);
// tests
AttributeSet textAttrs;
textPane.setCaretPosition(1);
textAttrs = textPane.getParagraphAttributes();
assertFalse(StyleConstants.isUnderline(textAttrs));
assertTrue(StyleConstants.isStrikeThrough(textAttrs));
assertEquals(StyleConstants.ALIGN_CENTER, StyleConstants.getAlignment(textAttrs));