Dims Dims - 1 year ago 99
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download