I have an FXML project from explicit path (C:\MyFXML). Inside this folder I have typical JavaFX directory structure generated from NetBeans ("build", "dist", "nbproject" and "src"). My goal is to load FXML files from external application using explicit path, so neither directory containing FXML project or main application are located in the same directory and doesn't haves relationship between them. I have some questions under this scenario:
1. Which directory should I use to load FXML file? I'm using "build/classes/MyFXML" because inside this folder are compiled stuff. That's right?
2. When I load FXML file, any directory works if no controllers are attached. Otherwise, compiler returns an ClassNotFoundException when tries to locate attached controller. How can I load FXML files with attached controllers? Can anyone post an example code?