FXML Load exception

The problem is in source

So, you've got to change it to a proper one

So do that, edit the source of the fxml file here

AnchorPane root = (AnchorPane) FXMLLoader.load(Main.class.getResource("LoginGUI.fxml"));

with this one

AnchorPane root = (AnchorPane) FXMLLoader.load(Main.class.getResource("/packagename/LoginGUI.fxml"));

I had the same problem today and for those who may have it and (like me) are looking for an answer for that:

You may have changed any component Id on your Controller file and forgot to update the Id on sceneBuilder (or FXML file)[or Vice-Versa], so the Controller can't link the component on View file.

For Exemple: (On Controller file)

@FXML
Button btnName1

(On FXML file or SceneBuilder)

fx:id="btnName_1"

:-)