Dims Dims - 7 months ago 52
Java Question

How load javafx.scene.image.Image by demand?

Is it possible to discard loaded content of Image and later load it again? Is it possible to load it on demand?

Can I have ImageView which loads it's image only on show?


No, there is no such functionality in Image contract. Image can load in background, but once loaded, it cannot be unloaded.

If using ImageView, then you should assign Image to it explicitly, but JavaFX doesn't provide a way for you to know when ImageView is actually shown.

To implement required close to ImageView, I was to fork it and highly utilize deprecated API with Prism, including NGImageView class.