Reputation: 2575
I'm using JavaFX2.2. Is it actually possible to get the ImageView used as a parameter in the constructor for an UI-control such as Button or Label after the UI-control has been created?
I want to change the image of a control. I could probably also do it with CSS, but I'm not sure of how to use jar-resources there.
Example:
Label label = new Label("", new ImageView(new Image(getClass().getResourceAsStream("test.png"))));
label.getImageView().setImage(...); // there is no such method getImageView()
Upvotes: 0
Views: 46