• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple STRING Question!

 
Mike Smike
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I've searched the forums and the API, but I can't find what I'm looking for!

I have say, a JTextArea, in which there are some strings. My problem is that I want the strings to be different colours. The only method I can find it the setForeGround(Color c) for the JTextArea, but this is no good as it colours all the text the same!

Surely there is a way to colour individual letters/words/strings differently??

If there isn't - please let me know. I found a post from 2001 asking something similar but with no answers! eek

Please help

Thanks for your time

Mike
[ February 17, 2005: Message edited by: Mike Smike ]
 
Lionel Badiou
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mike,

- Take a look at
Using text Components

- jEditorPane (or jTextPane) should meet your needs.

Hope that helps,
 
Mike Smike
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou muchos amigos! Very much appreciated. I will have a look at these JEditorPane and JTextPane things.

Mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic