1scene.widthProperty().addListener(new ChangeListener<Number>() {
2 @Override public void changed(ObservableValue<? extends Number> observableValue, Number oldSceneWidth, Number newSceneWidth) {
3 System.out.println("Width: " + newSceneWidth);
4 }
5});
6scene.heightProperty().addListener(new ChangeListener<Number>() {
7 @Override public void changed(ObservableValue<? extends Number> observableValue, Number oldSceneHeight, Number newSceneHeight) {
8 System.out.println("Height: " + newSceneHeight);
9 }
10});