Search code examples
bordervaadin7

Border around Layout


I would like to draw a border (outline) around a VerticalLayout. I don't want all my VerticalLayout components to have borders, just one of them. It's a Vaadin 7 project in Eclipse.


Solution

  • As far as I know the only way to do this is with CSS:

    VerticalLayout vl = new VerticalLayout();
    vl.addStyleName("layout-with-border");
    

    And then modify your theme (.scss file) to include:

    .layout-with-border {
        border: 1px solid black;
    }