This piece of code that I wrote creates 2 panels. The aim is to have one of them directly on top of the other with no space in between, but the problem is that there is a huge gap between them.
Cann anyone help me out with this?
Code:
Panel panel = new Panel();
Panel Logo = new Panel();
VerticalLayout layout1 = new VerticalLayout();
VerticalLayout layout2 = new VerticalLayout();
panel.setWidth("500px");
panel.setHeight("300px");
Logo.setWidth("500px");
Logo.setHeight("100px");
Logo.addStyleName(Runo.PANEL_LIGHT);
Label label = new Label("test");
label.setWidth(null);
Button test = new Button("test");
first.setStyleName("test");;
first.setClickShortcut(KeyCode.ENTER, null);
layout1.addComponent(test);
layout2.addComponent(label);
layout.addComponent(Logo);
layout.addComponent(panel);
layout.setComponentAlignment(panel, Alignment.MIDDLE_CENTER);
layout1.setComponentAlignment(test, Alignment.MIDDLE_CENTER);
layout2.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
layout.setSizeFull();
layout1.setSizeFull();
layout2.setSizeFull();
setContent(layout);
panel.setContent(layout1);
Logo.setContent(layout2);