This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
JTextPane default font
Adding Image, Bolds to JTextPane
Images
JTextPane +insert text,image with style
Scaling