Content not scrolling in panel

I have one cssLayout which contains one Panel with full size

CssLayout lay = new Csslayout();
Panel container = new Panel();
container.setSizeFull();
VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
container.setContent(layout);
layout.addComponent(new Label("<Big text which need to be scrolled>"));
lay.addComponent(container);

My problem is as the content is not fitting in panel it should be scrolled but it is not scrolling. What am I missing here?

Thank you in advance.

Hi,

remove the “layout.setSizeFull();” from your code, then the VerticalLayout will have undefined height - in other words it will take all the height the content needs and the panel should scroll.

-tepi

It works. Thank you

Now another problem. The content is scrolling but last 2-3 lines are not displaying. If i zoom out browser using Ctrl± shortcut then it displays whole content. What should i do in that case?

<vaadin-css-layout style-name="main-content" _id="maincontent" :expand="">

</vaadin-css-layout>

Panel container = new Panel();
container.setHeight("100%");
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
container.setContent(layout);
layout.addComponent(new Label("<Big text which need to be scrolled>"));

this.maincontent.addComponent(container);

Thank you in advance.