I am trying to make 3 folders in a Javafx
application. I have a Views
folder which will contain my views, and I want to load an fxml
file saved inside Views
. I wrote this code inside start
method:
Parent root = FXMLLoader.load(getClass().getResource("/Views/ProductView.fxml"));
My folders are structured as follows:
Apparently GetResources()
can't find my file. What am I doing wrong?
try something like this something like this
Parent root=FXMLLoader.load(getClass().getClassloader().getResource("application/Models/Views/ProductView.fxml")