Label lblOfflineLabel = new Label();
Timer offlineLabelTimer;
lblOfflineLabel.addStyleName("OfflineLabel");
lblOfflineLabel.addStyleName("OfflineLabel-blink");
offlineLabelTimer = new Timer() {
private boolean on = true;
public void run() {
if(on = !on) {
lblOfflineLabel.removeStyleName("OfflineLabel-blink");
} else {
lblOfflineLabel.addStyleName("OfflineLabel-blink");
}
}
};
ArunDhaJ wrote:
> Hi,
> I wanted to make a label to blink, like toggling two colors. I've
> implemented a timer to do the same.
> How can I know which color has been previously set ?? so that I can
> swap with the new color...
>
> //////////////////////////////////////////////////////////////
> Label lblOfflineLabel = new Label();
> Timer offlineLabelTimer;
> lblOfflineLabel.addStyleName("OfflineLabel");
> lblOfflineLabel.addStyleName("OfflineLabel-blink");
>
> offlineLabelTimer = new Timer() {
> public void run() {
> lblOfflineLabel.removeStyleName("OfflineLabel-blink");
> }
> };
>
> // blink at the rate of 2 second
> offlineLabelTimer.scheduleRepeating(2000);
> //////////////////////////////////////////////////////////////
>
> How to implement the run logic to toggle the two styles ???...
>
> .OfflineLabel{
> color: #FF0000;
> }
>
> .OfflineLabel-blink {
> color: #00FF00;
> }
>
>
> Thanks in advance !!!
>
> - ArunDhaJ
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---