Hi,

Consider 2 code snipet below:
My intention is to display "Hello" in Center of the page.

1. Using Label directly

Label l = new Label("NITESH");
l.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
RootPanel.get().add(l);

This displays it in center.

2. Label widget contained in Vertical/HorizontalPanel

-------------------------------------
HorizontalPanel hp = new HorizontalPanel();
Label l = new Label("Hello");
hp.add(l);
hp.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
//hp.setCellHorizontalAlignment(l,
HasHorizontalAlignment.ALIGN_CENTER);
RootPanel.get().add(hp);
-------------------------------------

If we replace HorizontalPanel with VerticalPanel we get result the
same.

How would I display my label at Center of page if its contained under
some Panel ? Am I missing something ?

10x

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to