Hi 5am,
This code will add a counter if there is a <div id="counter"></div> in the
page but won't if there isn't
Ian
public class Main implements EntryPoint
{
public void onModuleLoad()
{
addCounter();
}
private void addCounter()
{
if(RootPanel.get("counter") == null) return;
final Label label = new Label("Counter: 0");
RootPanel.get("counter").add(label);
new Timer()
{
int c = 0;
public void run()
{
label.setText("Counter: " + ++c);
}
}.scheduleRepeating(1000);
}
}
2008/8/26 Sam <[EMAIL PROTECTED]>
>
>
>
> Hi Lan
> It will be helpfull if you can explain with the example .
> Thanks
> Samir
>
> >
>
--
Ian
http://examples.roughian.com
___________________________________
Life is either a daring adventure or nothing.
Security is mostly a superstition.
It does not exist in nature.
- Helen Keller
___________________________________
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---