Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTextPane and Justified Paragraphs

 
Stephan Bardubitzki
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Stephan Bardubitzki
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic