Guest User

Untitled

a guest
Sep 25th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. import com.google.gwt.core.client.EntryPoint;
  2. import com.google.gwt.user.client.ui.RootPanel;
  3. import com.sencha.gxt.core.client.util.Margins;
  4. import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer;
  5. import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer.HorizontalLayoutData;
  6. import com.sencha.gxt.widget.core.client.form.FieldLabel;
  7. import com.sencha.gxt.widget.core.client.form.FieldSet;
  8. import com.sencha.gxt.widget.core.client.form.FormPanel.LabelAlign;
  9. import com.sencha.gxt.widget.core.client.form.TextField;
  10.  
  11. public class HlcHtmlWidthIssue implements EntryPoint {
  12.  
  13. @Override
  14. public void onModuleLoad() {
  15.  
  16. FieldLabel field1 = new FieldLabel(new TextField(), "label label label");
  17. field1.setLabelAlign(LabelAlign.TOP);
  18.  
  19. FieldLabel field2 = new FieldLabel(new TextField(), "label label label");
  20. field2.setLabelAlign(LabelAlign.TOP);
  21.  
  22. FieldLabel field3 = new FieldLabel(new TextField(), "label label label");
  23. field3.setLabelAlign(LabelAlign.TOP);
  24.  
  25. HorizontalLayoutContainer hlc = new HorizontalLayoutContainer();
  26. hlc.add(field1, new HorizontalLayoutData(190, -1, new Margins(0, 0, 0, 10))); // 190 - (padding 10) = 180 px wide
  27. hlc.add(field2, new HorizontalLayoutData(190, -1, new Margins(0, 0, 0, 10))); // 190 - (padding 10) = 180 px wide
  28. hlc.add(field3, new HorizontalLayoutData(190, -1, new Margins(0, 10, 0, 10))); // 190 - (padding 20) = 170 px wide
  29.  
  30. FieldSet fieldset = new FieldSet();
  31. fieldset.add(hlc);
  32. fieldset.setPixelSize(800, 300); // 3*190=570
  33.  
  34. RootPanel.get().add(fieldset);
  35. }
  36.  
  37. }
Add Comment
Please, Sign In to add comment