Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.google.gwt.core.client.EntryPoint;
- import com.google.gwt.user.client.ui.RootPanel;
- import com.sencha.gxt.core.client.util.Margins;
- import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer;
- import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer.HorizontalLayoutData;
- import com.sencha.gxt.widget.core.client.form.FieldLabel;
- import com.sencha.gxt.widget.core.client.form.FieldSet;
- import com.sencha.gxt.widget.core.client.form.FormPanel.LabelAlign;
- import com.sencha.gxt.widget.core.client.form.TextField;
- public class HlcHtmlWidthIssue implements EntryPoint {
- @Override
- public void onModuleLoad() {
- FieldLabel field1 = new FieldLabel(new TextField(), "label label label");
- field1.setLabelAlign(LabelAlign.TOP);
- FieldLabel field2 = new FieldLabel(new TextField(), "label label label");
- field2.setLabelAlign(LabelAlign.TOP);
- FieldLabel field3 = new FieldLabel(new TextField(), "label label label");
- field3.setLabelAlign(LabelAlign.TOP);
- HorizontalLayoutContainer hlc = new HorizontalLayoutContainer();
- hlc.add(field1, new HorizontalLayoutData(190, -1, new Margins(0, 0, 0, 10))); // 190 - (padding 10) = 180 px wide
- hlc.add(field2, new HorizontalLayoutData(190, -1, new Margins(0, 0, 0, 10))); // 190 - (padding 10) = 180 px wide
- hlc.add(field3, new HorizontalLayoutData(190, -1, new Margins(0, 10, 0, 10))); // 190 - (padding 20) = 170 px wide
- FieldSet fieldset = new FieldSet();
- fieldset.add(hlc);
- fieldset.setPixelSize(800, 300); // 3*190=570
- RootPanel.get().add(fieldset);
- }
- }
Add Comment
Please, Sign In to add comment