I have a problem which appears when I export to runnable jar.
Basically I am creating a JavaFx Game which loads Images by using:
Image image = new Image(BlueCar.class.getResource("../resources/blueCar.png").toExternalForm());
Everything works fine within eclipse. However when I try to export and run it give a error on the line of code above.
http://i.imgur.com/VbmGSO3.jpg
I am using MVC Pattern for the application so I have packages separating the class from the images resources:
http://i.imgur.com/gzm7d0s.jpg
Please if you could help know what I am doing wrong please ?
Jar文件系统不支持相对路径-使用绝对路径getClass()。getClassloader()。getResource(“ path / to / resource / blueCar.jpg”)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.