• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextPane and Justified Paragraphs  RSS feed

 
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
 
Ranch Hand
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
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!