How to change the colors of the Text along with different inputs? [message #461860] |
Mon, 03 October 2005 17:19 |
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
|
|
|
Re: How to change the colors of the Text along with different inputs? [message #461861 is a reply to message #461860] |
Mon, 03 October 2005 17:24 |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
"eclipse.newcomer" <qingxing20052@gmail.com> wrote in message
news:dhrp6d$4rb$1@news.eclipse.org...
> 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?
>
Use StyledText.
---
Sunil
|
|
|
|
Powered by
FUDForum. Page generated in 0.04707 seconds