Hi guys,
this should probably be an easier question for the folks with more experience :-).
I’m currently trying to get my components somehow centered in my application and found nothing understandable during my ongoing research yet.
So that for example this code gets its components centered, and not on the left side.
private VerticalLayout buildLoginView() {
loginLayout = new VerticalLayout();
// infoLabel
infoLabel = new Label();
infoLabel.setValue("info");
loginLayout.addComponent(infoLabel);
// loginForm
loginForm = new LoginForm();
loginForm.setStyleName("v-loginform");
loginLayout.addComponent(loginForm);
// registerButton
registerButton = new Button();
registerButton.setCaption("Register");
loginLayout.addComponent(registerButton);
return loginLayout;
}
I’ve removed the listeners for achieving a better readability here.
I have tried adding
loginLayout.setComponentAlignment(infoLabel, Alignment.TOP_CENTER);
loginLayout.setComponentAlignment(loginForm, Alignment.MIDDLE_CENTER);
before retunring the loginLayout, but it did not work :-(.
So if anyone of you could help me, I’d be very happy and thankful.
I dont know yet how it works with this .css-files that can be added, so if we could find a java-solution, it’d be great
Thanks a lot!