Layout takes up space even when invisible


I have a trouble with the adding components to my main layout and then call the method setVisible(false). After I do this they still take up the space in the main layout. The components I add are them self VerticalLayouts. Anyone got a suggestion for this problem?


if you have spacing enabled in your main layout, the spacing will still be rendered even though the components are set non-visible. Try setSpacing(false); on your main layout, or remove the components completely.


It didn’t help with the spacing but I did remove all components and only add them when they should be visible. But its still strange I think since the api says that the visibility should remove all elements and adjust its containers if I dont remember totaly wrong.