Padding inside Panel Component


The components inside panel are getting a margin of 26px around them. I am not changing any default styles for these components. Not able to find where it is coming from.

Is there a way to change them easily for Panel?

Found the solution.

                    // Adjust the panels default layout (a VerticalLayout)
	        VerticalLayout layout = (VerticalLayout) mypanel.getContent();
	        layout.setMargin(false); // we don't want a margin
	        layout.setSpacing(false); // and no spacing between components

As you found out, Vaadin Panels and Windows contain a VerticalLayout by default inside them, and that layout has margins enabled.

Spacing is not enabled by default, so you should need to disable that, though.

Thanks Jouni. That is helpful. Got the code sampler demos.