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.

WindowMaxHeight.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package com.vaadin.tests.components.window;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.ui.Panel;
  4. import com.vaadin.ui.UI;
  5. import com.vaadin.ui.VerticalLayout;
  6. import com.vaadin.ui.Window;
  7. @SuppressWarnings("serial")
  8. public class WindowMaxHeight extends UI {
  9. @Override
  10. protected void init(VaadinRequest request) {
  11. WindowNotFullHeight window = new WindowNotFullHeight();
  12. addWindow(window);
  13. window.focus();
  14. }
  15. class WindowNotFullHeight extends Window {
  16. public WindowNotFullHeight() {
  17. setCaption("Should be 200px high");
  18. setWidth(200, Unit.PIXELS);
  19. VerticalLayout layoutRoot = new VerticalLayout();
  20. layoutRoot.setMargin(false);
  21. layoutRoot.setSpacing(false);
  22. Panel container = new Panel();
  23. container.setHeight(200, Unit.PIXELS);
  24. VerticalLayout containerContent = new VerticalLayout();
  25. containerContent.setMargin(false);
  26. containerContent.setSpacing(false);
  27. for (int i = 0; i < 300; i++) {
  28. Panel hello = new Panel("hello");
  29. containerContent.addComponent(hello);
  30. }
  31. container.setContent(containerContent);
  32. layoutRoot.addComponent(container);
  33. setContent(layoutRoot);
  34. }
  35. }
  36. }