text color automatic change

Anyone please help me..If I type the word hello in JTextPane its become blue and If I type world its become red, for other words nothing is changeI don't know how to do this in my programplease anyone help me!!
[239 byte] By [henyoa] at [2007-10-3 4:11:13]
# 1
If you read the API doc for JTextPane it has links to StyledEditorKit and the tutorial for 'Using Text Components.' That has a link to 'How to Use Editor Panes and Text Panes.'So try that first :o)
itchyscratchya at 2007-7-14 22:11:41 > top of Java-index,Desktop,Core GUI APIs...
# 2

Quit cluttering the forum asking the same question over and over again.

You've been told this question has been asked over and over again in the forum. You been asked to search the forum to find these postings. You've even been given the keywords to use in your search.

So quit wasting our time and do some work on your own.

camickra at 2007-7-14 22:11:41 > top of Java-index,Desktop,Core GUI APIs...