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.

TestIFrames.java 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. package com.vaadin.tests;
  2. import com.vaadin.shared.ui.ContentMode;
  3. import com.vaadin.ui.CustomComponent;
  4. import com.vaadin.ui.Label;
  5. import com.vaadin.ui.VerticalLayout;
  6. public class TestIFrames extends CustomComponent {
  7. VerticalLayout main = new VerticalLayout();
  8. public TestIFrames() {
  9. setCompositionRoot(main);
  10. createNewView();
  11. }
  12. public void createNewView() {
  13. main.removeAllComponents();
  14. main.addComponent(createEmbedded("http://demo.vaadin.com/sampler/"));
  15. main.addComponent(createEmbedded("../colorpicker"));
  16. // main.addComponent(createEmbedded("../TestForNativeWindowing"));
  17. main.addComponent(createEmbedded("http://demo.vaadin.com/timeline"));
  18. main.addComponent(createEmbedded("http://demo.vaadin.com/colorpicker"));
  19. }
  20. private Label createEmbedded(String URL) {
  21. final int width = 600;
  22. final int height = 250;
  23. final String iFrame = "<iframe height=\"" + height + "\" width=\""
  24. + width + "\" src=\"" + URL + "\" />";
  25. return new Label(iFrame, ContentMode.HTML);
  26. }
  27. }