You add the styles to the document of the JTextPane. There is a page in the java tutorial that has an example (application) of adding styles to a styled document: How to Use Editor Panes and Text Panes.
I tried this way before, but it hasn'nt been working, too.
posted 13 years ago
That is a really big piece of pie for such a tiny ad: