Forums Register Login

how to color a particular word in jtextpane ?

+Pie Number of slices to send: Send
i m making a text editor in that when ever user type a certain java keyword like void just that word will be appeared as blue and rest other work should be red
i m using keylistener but unfortunately my logic is notworking here
what is happening here is when i write some thing like
class void then i press enter then the color of the text changes to red and from then on the entire text is written in red color
same is the case with blue ....so please can you tell me where i m wrong and what is key thing in this which i m missing ?
if you can provide some example than that would be great help because in the google every code is not understandable
+Pie Number of slices to send: Send
This is still the same problem as this one. UseOneThreadPerQuestion.
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


Reply locked
This thread has been viewed 1859 times.
Similar Threads
Changing Color of a selectedtext in TextArea
How can we make highlight some text in text editor in java????
Exception
Will a started thread run to completion in this example?
wriring code for an EDITOR big problem??
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:08:12.