On Jun 17, 3:11 pm, Sanj <[email protected]> wrote: > And as the differences what i am thinking there is major difference > i.e. in my case everytime these lines will execute :- > > hp.clear(); > Label label = new Label("Well hello there!"); > hp.add(label); > > But object creation is same. > > And any major differences i.e. is lazyPanel help me for increasing the > loading time of widgets. > Sanj
In your example there is one important difference: The lazy panel example will only ever have one label created, and your example will create a new label every time a button is pressed. If you were to work around it with the label variable store a a field, using a if (label == null) label = new Label(); hp.add(label) would remove the widget creations, but not widget insertions. The main thing is conceptually though, if you add a lazy panel to a widget, a panel has been added. So hp.getChildCount() will count the lazy panel, which might be important for other things. Lazy panel is mainly a convenience for the whenNeeded() -> if (! created) create() methods, and shines in complex composites in, say, tab panels. Gert --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
