Answers for "javafx only applies on window resize"

1

javafx resizable window

scene.widthProperty().addListener(new ChangeListener<Number>() {
    @Override public void changed(ObservableValue<? extends Number> observableValue, Number oldSceneWidth, Number newSceneWidth) {
        System.out.println("Width: " + newSceneWidth);
    }
});
scene.heightProperty().addListener(new ChangeListener<Number>() {
    @Override public void changed(ObservableValue<? extends Number> observableValue, Number oldSceneHeight, Number newSceneHeight) {
        System.out.println("Height: " + newSceneHeight);
    }
});
Posted by: Guest on April-22-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language