String image = JavaFXApplication9.class.getResource("splash.jpg").toExternalForm();
root.setStyle(" -fx-background-image: url('" + image + "');
-fx-background-position: center center;
-fx-background-repeat: stretch;");
Can anyone help me figure this out? :S I’ve tried a lot.
I know it’s a small error.
Try to clean and re-build the project.
EDIT:
Edit your start method according to this working one:
Be sure that the splash.jpg image file is in the same package of your main class.