How to place a tabSheet without using of CSS?

Hello everyone ,

I have to create a form with Vaadin. My problem is the following one:

I have at present a tabSheet component and I would like I could place it in right of my page. (It takes place to the left by default).
I would like to know if it is possible to make it without using of CSS.

I already have to try to place it in Layout and of to make Layout.setComponentAlignment(myTabSheet,Alignment.TOP_RIGHT) but it does not work as I wait for it.

Thanks.

Fanny

Hey.

The fix that you provided should work fine. I guess that you have some size definitions wrong. Check that the parent layout’s width is set to 100% and not undefined. If it is undefined then it will actually be just as wide as the tabsheet, and component alignment won’t have any visual effect.

At least this worked for me as expected:

public class PlaygroundApplication extends Application {
	private static final long serialVersionUID = 6031735832707957247L;

	@Override
	public void init() {
		VerticalLayout vl = new VerticalLayout();
		Window mainWindow = new Window("Test Application", vl);
		setMainWindow(mainWindow);
		setTheme("playgroundtheme");

		TabSheet tabsheet = new TabSheet();
		tabsheet.setWidth("300px");
		tabsheet.setHeight("300px");
		
		vl.addComponent(tabsheet);
		vl.setComponentAlignment(tabsheet, Alignment.TOP_RIGHT);
	}
}