Size of the application problem to open

Hi,
How can I take the screen size to open the application.
I want to add to my CustomLayout mainWindow to open the application and I want it to take all the custom screen size (at least for the width).

//class Application
Window mainWindow;
public void applicationInit () {
            mainWindow = new Window(TM.get("app.titre"));
	    CustomRoot customRoot = new CustomRoot();
            mainWindow.addComponent(customRoot);
            mainWindow.getContent().setHeight(null);
            mainWindow.getContent().setWidth(null);
            CustomRoot customRoot = new CustomRoot();
            mainWindow.addComponent(customRoot);
            setMainWindow(mainWindow);
}

and the CustomRoot


public class CustomRoot extends VerticalLayout {

    private Logger log4j = Logger.getLogger(CustomRoot.class);
    MenuBar menu = new MenuBar();
    boolean isManageUrls = false;
    TPTMultiView controller = new TPTMultiView(isManageUrls);
    CustomEntete entete;
    Window.Notification notif = null;

    public CustomRoot() throws Exception {
        addCaracteristiques();
        placerComposants();
    }

    private void addCaracteristiques() throws Exception {
        UserApp user = (UserApp) TPTApplication.getCurrentApplication().getUser();
        entete = new CustomEntete();// extend CustomLayout
        menu.setImmediate(true);
    }

    private void placerComposants() {
        addComponent(entete);
        addComponent(menu);
        addComponent(controller);
        setComponentAlignment(entete, Alignment.MIDDLE_CENTER);
        setComponentAlignment(menu, Alignment.MIDDLE_CENTER);
        setComponentAlignment(controller, Alignment.MIDDLE_CENTER);
    }

}

The concern is that the CustomRoot does not take the full width of the screen
thank you for your help.

Hi,
I’m not sure I was clear in my post.
So I try to be clearer,
I want to open my application components are all screen size.
I do not want to put size on hard.
I find this problem often knowing that I use sometimes and other times CustomLayout VerticalLayout.
Thank you for your help.

I still !
I found the solution!
in fact it should not be mainWindow.addComponent(customRoot);
but be mainWindow.setContent (customRoot)
cordially,