I have the following piece of code that I wrote in Vaadin.
The problem is that the alignment does not work. I set it to bottom_center, but the components are all stuck to the top (top_center) of my web browser.
Can anyone help me out with this?
VerticalLayout layout = new VerticalLayout();
VerticalLayout layout1 = new VerticalLayout();
Panel panel = new Panel();
Button button = new Button("Enter");
Button login = new Button("Login");
The reason for the components appering to be aligned to the top is that you haven't specified a height for your VerticalLayouts. When you don't specify a size for a layout, its size is determined by the child components it contains. In such a case, setting the alignment won't make any difference, as there's no extra room inside the layout's slots.
Set the size, using e.g.
layout.setSizeFull(); and you should notice the difference immediately.