You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Ticket1869.java 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package com.vaadin.tests.tickets;
  2. import com.vaadin.ui.Button;
  3. import com.vaadin.ui.GridLayout;
  4. import com.vaadin.ui.HorizontalLayout;
  5. import com.vaadin.ui.Panel;
  6. import com.vaadin.ui.Root.LegacyWindow;
  7. import com.vaadin.ui.VerticalLayout;
  8. public class Ticket1869 extends com.vaadin.Application.LegacyApplication {
  9. @Override
  10. public void init() {
  11. GridLayout lo = new GridLayout(2, 1);
  12. setMainWindow(new LegacyWindow("#1869", lo));
  13. lo.setMargin(true);
  14. lo.setSpacing(true);
  15. VerticalLayout el = new VerticalLayout();
  16. Panel elp = new Panel(
  17. "Vertical ExpandLayout /w first component expanded", el);
  18. el.setHeight("1000px");
  19. for (int i = 0; i < 3; i++) {
  20. Button b = new Button("x");
  21. el.addComponent(b);
  22. if (i == 0) {
  23. b.setSizeFull();
  24. el.setExpandRatio(b, 1);
  25. }
  26. }
  27. lo.addComponent(elp);
  28. elp.setWidth("300px");
  29. elp.setHeight("300px");
  30. HorizontalLayout elh = new HorizontalLayout();
  31. Panel elph = new Panel(
  32. "Horizontal ExpandLayout /w first component expanded", elh);
  33. elh.setWidth("1000px");
  34. for (int i = 0; i < 3; i++) {
  35. Button b = new Button("x");
  36. elh.addComponent(b);
  37. if (i == 0) {
  38. b.setSizeFull();
  39. elh.setExpandRatio(b, 1);
  40. }
  41. }
  42. lo.addComponent(elph);
  43. elph.setWidth("300px");
  44. elph.setHeight("300px");
  45. }
  46. }