aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTextPane and Justified Paragraphs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextPane and Justified Paragraphs" Watch "JTextPane and Justified Paragraphs" New topic
Author

JTextPane and Justified Paragraphs

Stephan Bardubitzki
Greenhorn

Joined: Dec 26, 2005
Posts: 29
Hi all,

I have to display some formatted paragraphs in a JTextPane. Each paragraph should have a header in bold letters and following some justified text. I can change font style and color, but the justified alignment won't happen with this code:


Any suggestions to solve the task are highly appreciated.

Thanks in advance.
Stephan
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Stephan Bardubitzki
Greenhorn

Joined: Dec 26, 2005
Posts: 29
Thank you very much Craig, works like a charm.
Hmmm... the last line of the paragraph should be aligned left. Any ideas?
Sorry, I'm not very familiar with text components.

Stephan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTextPane and Justified Paragraphs
 
Similar Threads
Images
JTextPane default font
Scaling
Adding Image, Bolds to JTextPane
JTextPane +insert text,image with style