I have a problem with my Java class. Actually the code is correctly, but if I click the run-button there's a exception caused of the path of the image.
static Image currentBackground = new Image("Snake/Images/background_options.png", true);
And the compiler's message is:
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
Caused by: java.lang.IllegalArgumentException: Invalid URL: Invalid URL or resource not found
at javafx.scene.image.Image.validateUrl(Image.java:1100)
at javafx.scene.image.Image.<init>(Image.java:624)
at view.OptionsWindow.<clinit>(OptionsWindow.java:21)
... 3 more
Caused by: java.lang.IllegalArgumentException: Invalid URL or resource not found
at javafx.scene.image.Image.validateUrl(Image.java:1092)
... 5 more
Process finished with exit code 1
Can anybody help me?
See Question&Answers more detail:os