I have the following JavaFx application and use Scene builder. I want my scene to have the screen resolution 1920*1080:
My display has following resolution:
But after running code I have the application that can't even fit into my window. Is this caused by incorrect scaling, or something else?
CodePudding user response:
this ?
double height= Screen.getPrimary().getBounds().getHeight();
double width= Screen.getPrimary().getBounds().getWidth();
scene = new Scene(root,width , height);
tho your title is asking for something that's done by default as size infos are registered in the xml used to create your views.
CodePudding user response:
Try Adding the below piece of code in your main class. This will maximize the window to fit your screen resolution
Note: However the size of the icons which are shown on your app screen may not change.
stage.setMaximized(true);