//for max screen size stage.setMaximized(true); //to prevent max screen size stage.setMaximized(false);