I'm trying to load an image from a file without using a FileChooser
.
The folders are:
TestProject
-src
--application
---(all_the_classes_i'm_using.java)
-assets
--drawIcon.png
I want to load the image in the assets folder.
I've tried:
Image image = new Image("../assets/drawIcon.png")
Image image = new Image(getClass().getResourceAsStream("../assets/drawIcon.png"))
I've tried it with the string path "/TestProject/assets/drawIcon.png", but nothing. I don't understand how to load this image!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…