javafx envent detact when stage resized code example
Example: javafx event resize
Stage stage = new Stage();
stage.widthProperty().addListener((obs, oldVal, newVal) -> {
//on change width
});
stage.heightProperty().addListener((obs, oldVal, newVal) -> {
//on change height
});