Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Alignment for centering text in JTextPane does not work  RSS feed

 
Constanze Michaelis
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi @ll.

I tried to use JTextPane to center a text which should be displayed to users for information.


What did I do wrong?

bye
Constanze
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You add the styles to the document of the JTextPane. There is a page in the java tutorial that has an example (application) of adding styles to a styled document: How to Use Editor Panes and Text Panes.
 
Constanze Michaelis
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You add the styles to the document of the JTextPane. There is a page in the java tutorial that has an example (application) of adding styles to a styled document: How to Use Editor Panes and Text Panes.



I tried this way before, but it hasn'nt been working, too.

bye
Constanze
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!