I am able to change attributes to JTextPane but unable to align the text. I used DefaultStyledDocument during creation of JTextPane and uses insertString method as explained in usage of TextCmponents at sun site. I used setPreferredSize() method of JTextPane.
permaculture is largely about replacing oil with people. And one tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop