This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
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.