| Author |
Highlighting Words in a String
|
Muhammad Ahsan Jamshaid
Ranch Hand
Joined: Jun 01, 2006
Posts: 59
|
|
Hi all.. i am making a search function... now i can find the word in a string but i want the finded word to be shown highlighted (in a tree or TextFeild) . Is there any thing that make a String in which some specific words are highlighted or Bold or Color not the whole string... The return type remains a string.... Or any other suggestion to do it...... --Ahsan Jamshaid..
|
--Ahsan Jamshaid... SCJP 5(80%)
|
 |
Petrus Pelser
Ranch Hand
Joined: Feb 20, 2006
Posts: 132
|
|
Take a look at javax.swing.text.JTextComponent setSelectionStart(), setSelectionEnd(), and setSelectionColor(). You select the text and then change its colour.
|
 |
 |
|
|
subject: Highlighting Words in a String
|
|
|