Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes displaying words in different fonts or colors in a textarea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "displaying words in different fonts or colors in a textarea" Watch "displaying words in different fonts or colors in a textarea" New topic
Author

displaying words in different fonts or colors in a textarea

bhagavatula indu sekhar
Ranch Hand

Joined: Sep 17, 2006
Posts: 34
how can i display text in a Textarea in different colors or fonts?
how can i set the cursor postion in Textarea?
jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
Use html and the Swing/Java Html based components (google) ...
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> how can i display text in a Textarea in different colors or fonts?

use a JTextPane


> how can i set the cursor postion in Textarea?

setCaretPosition()
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: displaying words in different fonts or colors in a textarea