Adjust stage size after changing the scene

This commit is contained in:
Kai S. K. Engelbart 2020-06-10 10:05:25 +02:00
parent 30567ed1ef
commit c228519d4b
1 changed files with 2 additions and 0 deletions

View File

@ -108,6 +108,7 @@ public final class SceneContext {
sceneStack.push(scene);
stage.setScene(scene);
applyCSS();
stage.sizeToScene();
stage.show();
} catch (IOException e) {
throw new RuntimeException(e);
@ -124,6 +125,7 @@ public final class SceneContext {
if (!sceneStack.isEmpty()) {
stage.setScene(sceneStack.peek());
applyCSS();
stage.sizeToScene();
}
stage.show();
}