+ 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

2nd May 2017, 11:32 AM
Ridwan
Ridwan - avatar
7 Réponses
+ 10
You're welcome ^^
2nd May 2017, 5:35 PM
Tashi N
Tashi N - avatar
+ 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.
2nd May 2017, 5:33 PM
Tashi N
Tashi N - avatar
+ 7
You have to create a resource folder then and add the image there.
2nd May 2017, 5:29 PM
Tashi N
Tashi N - avatar
+ 6
Image img = new Image("yourPath/image.png"); ImageView imgView = new ImageView(img);
2nd May 2017, 4:48 PM
Tashi N
Tashi N - avatar
+ 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????
2nd May 2017, 5:29 PM
Ridwan
Ridwan - avatar
+ 2
Thanks a lot..I'll try that out😊✌
2nd May 2017, 5:34 PM
Ridwan
Ridwan - avatar
+ 1
please how do I do that?
2nd May 2017, 5:30 PM
Ridwan
Ridwan - avatar