StyleSheet
javax.swing.JTextPane
javax.swing.text.html.StyleSheet
JTextPane textPane; StyleSheet css = new StyleSheet(); css.addRule("p {margin: 0; font-family: Arial, sans-serif; font-size: 12px; }"); ((HTMLEditorKit)textPane.getEditorKit()).setStyleSheet(css);