+ 2
Hello Guys.pls what's the best way to create a javafx Imageview using: ImageView img=new ImageView(Image object).Thanks
JavaFX Image View
7 Answers
+ 10
You're welcome ^^
+ 9
Do you use a ide? Then just right click on the package > new > resource folder (or something similar depending on the ide you use). I think the help files of your ide will provide you better instructions.
+ 7
You have to create a resource folder then and add the image there.
+ 6
Image img = new Image("yourPath/image.png");
ImageView imgView = new ImageView(img);
+ 2
Thanks for the reply..I read a shortcut that doesn't include writing all the Image directory (by placing the image in the same file as the class file) Anyone can explain that better????
+ 2
Thanks a lot..I'll try that outđâ
+ 1
please how do I do that?