Loader instantiation throws nullpointer in JavaFX
I have declared two fxml files and a controller for each one: rootlayoutcontroller is a controller for rootlayout.fxml and overviewcontroller is a controller for overview.fxml rootlayout has menu bar with file open item, and overviewcontroller has a Draw button. I have another class called DataStructure. I want to open a file and send the path to overviewcontroller. Then when I click Draw the constructor of DartaStructure shall get instantiated, with the path as parameter. But as soon as I click open, on file chooser open dialog, the program throws an nullpointer for in handleOpen() method.