How to change the colors of the Text along with different inputs? [message #610911] |
Mon, 03 October 2005 17:18 |
Eclipse User |
|
|
|
Originally posted by: qingxing20052.gmail.com
Dear all:
I met one probelm and hope to get some helps from you.
* My scenario:
There are two buttons, A and B. When A is pressed, the word "A" which is
blue will appear in textArea. Whereas when B is pressed, the word "B" which
is red will appear in textArea. I used the following method:
A mouse down event:{
textArea.setForeground(Specific Color);}
The result: All the comment in textArea are changed along with different
pressings of A and B. E.g. When button A is firstly pressed, word "A" is
blue. After that button B is pressed, the previous word "A" and latter word
"B" are changed (red) both. It is not my expected. My expected result is:
"A" still remain in blue, only "B" is in red. I know the method
sefForeground is not fit for my requirement. But is there any other mehtod
that I can use?
Any suggestion is welcome.
I am looking forward to hearing from you.
thx for your kindness and helps.
B.W.
N.B
|
|
|
Powered by
FUDForum. Page generated in 0.03497 seconds