javafx fxmlloader location is not set

Solutions on MaxInterview for javafx fxmlloader location is not set by the best coders in the world

showing results for - "javafx fxmlloader location is not set"
Cristina
31 Jun 2019
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
similar questions
queries leading to this page
javafx fxmlloader location is not set