I have a VerticalPanel that I would like to appear in the center of a browser window and remain in the center on browser resizes.
RootLayoutPanel rlp = RootLayoutPanel.get();
VerticalPanel vp = new VerticalPanel();
vp.add(new Label("Line 1"));
vp.add(new Label("Line 2"));
vp.add(new Label("Line 3"));
rlp.setWidgetLeftRight(vp, 40, Unit.PCT, 40, Unit.PCT);
rlp.setWidgetTopBottom(vp, 40, Unit.PCT, 40, Unit.PCT);
This gets close but (obviously) doesn't calculate the middle correctly. Also it is important that the center of vp is placed in the middle of the screen and not the upper left corner of vp.
I am looking for an all-Java solution if possible. I have already spent about 8 hours on this.
I really appreciate the help!
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To post to this group, send email to email@example.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
Post a Comment