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

Styled TextAreas  RSS feed

 
mais jabr
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys..
I have a problem with styled TextAreas so if anyone can help me with that?
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Switch to JTextPane instead, that works with StyledDocument instead of Document. Even though the getDocument() method still returns a Document, you can only initialize JTextPane with a StyledDocument so that will be what is actually returned by the getDocument() method.

With the StyledDocument, you should be able to add any style with the setCharacterAttributes and setParagraphAttributes methods.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!