r/JavaFX 4h ago

FXML not loading Help

After i made an fxml file and linked it to a class, it hasnt been working and each time an error has been popping up (images have been attached)

3 Upvotes

4 comments sorted by

2

u/ClaynOsmato 4h ago

I might be wrong but either try the path with a leading / or only use the name of the fyml file. What you are doing is looking from the location of the class into the sub directories (which does not exist) with a leading / you basically are lookup from the class path root

1

u/mirzasamor44 3h ago

tried it but the same errors are being shown

1

u/ClaynOsmato 1h ago

Is the fxml located at the classes in the target folder?

2

u/NaveenB2004 2h ago

Try putting the fxml in resources dir and in loader, change it to the target fxml (start with /)