Cant center vertical layout?

I’m currently trying to center my layout but for some reason nothing changes.This is my code:

	VerticalLayout vLayout = new VerticalLayout();
	VerticalLayout buttons = new VerticalLayout(lHeader, merchantSearch, addMerchant, showMerchants);
	public MainMenuView() {
		vLayout.setComponentAlignment(buttons, Alignment.MIDDLE_CENTER);

		addMerchant.addClickListener(e -> addMerchant());
		showMerchants.addClickListener(e -> showMerchants());
		merchantSearch.addClickListener(e -> merchantSearch());


This is my first time using Vaadin, I hope someone can help

If I’m looking at this correctly, you’re putting the buttons layout in the MIDDLE_CENTER alignment inside the vLayout layout. This only centers the buttons layout, not the components inside it. You also probably want to align each button inside the buttons layout, now they’re all in the default positions inside their layout, not in the center.

If you open the Debug mode (add ?debug at the end of the application URL), you can examine the connector hierarchy tree; that will highlight the components so you can see how the space is being divided. Same thing can also be done with browser developer tools.