Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Styled TextAreas

 
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: 20822
68
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!