1 //CHECK THE FULL ANSWER BUT THIS MIGHT BE A QUICK FIX
2 //DON'T USE .. IN THE PATH
3
4 // FXML file in the same package as the current class:
5 URL fxmlURL = getClass().getResource("MyFile.fxml");
6 Parent root = FXMLLoader.load(fxmlURL);
7
8 // FXML file in a subpackage called `fxml`:
9 URL fxmlURL2 = getClass().getResource("fxml/MyFile.fxml");
10 Parent root2 = FXMLLoader.load(fxmlURL2);
11
12 // Similarly for images:
13 URL imageURL = getClass().getResource("myimages/image.png");
14 Image image = new Image(imageURL.toExternalForm());
15