Menubar horizontal align: center

Hello,

I´ve got a Problem to center my MenuBar.
To make it more understandable i uploaded a screenshot.

This menubar on the top should centered.

MyCode:

	/**
	 * creates the menu bar
	 * 
	 * @param visibleMenuBar
	 *        is the menu bar visible?
	 */
	private void createMenuBar(boolean visibleMenuBar)
	{
		this.menubar = new MenuBar();
		this.menubar.setWidth("100%");
		this.menubar.setStyleName("pd_page_menubar");
		// this.menubar.setVisible(visibleMenuBar);
		this.rootLayout.addComponent(this.menubar);
		this.rootLayout.setComponentAlignment(this.menubar, Alignment.MIDDLE_CENTER);
	}

Can anybody say me how i can center the menubar?

Ist it possible ?

Thanks
Dominik

Your problem is that the width of the menubar is 100%, so it 's takes all the horizontal space which is available, try to set it to undefined (setWidth(null)).

thanks now it works!