In my Javafx application, I have a gallery. What I want to do is that, as soon as an Image is available available in a folder, it should show that Image on the screen.
Is there anyway to bind an Image
in an IamgeView
. Just like any other String or Property? I can have something called ImageProperty and it will be binded to the Image. So if I change the image in the ImageProperty, it will update the UI
Done. ImageView has an Object Property to which an ObjectProperty can be binded.
i.e.
private ObjectProperty<javafx.scene.image.Image> imageProperty = new SimpleObjectProperty<>();
@FXML
private ImageView imageDisplay;
Bindings.bindBidirectional(this.imageDisplay.imageProperty(), GlobalModel.getInstance().getProject().getImageProperty());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With