Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!
RuneMate will permanently shut down on August 7, 2026
due to events outside our control. You can continue using RuneMate until this date after which it will no longer be available. Thank you to everyone that contributed to RuneMate's success and to the community for the opportunity to serve you all these years.

  • Learn about RuneMate Vault and how its zero knowledge local encryption already protects your sensitive information.
  • Edit or delete your RuneMate account from your Account Settings.
  • All account upgrade subscriptions have been cancelled. No action required.

Resolved How To Load An Image From Resources

Joined
Apr 19, 2016
Messages
55
I have an imageView in a '.FXML' file and I want to provide it an image. Is there a way to do it manually, in SceneBuilder? If not, how would I do it using the Resources class? I have tried using the following but without luck:
Code:
Resources.getAsBufferedImage(SOME_IMAGE_STR)
 
Client Developer
Joined
Oct 12, 2015
Messages
3,817
@FXML
private ImageView img;

....

//In your initialise
Image image = new Image(Resources.getAsStream("path to your image"));
img.setImage(image);


^^ From memory, feel free to correct me @Savior
 
Also, you should join the developer Slack chat, you're likely to get a quicker answer.

Slack
 
Top