I have an application that is a hybrid of Swing (legacy) and JavaFX components. It worked fine until I tried inserting a Preloader into the mix, now all my JavaFX components that utilize fxml files and the FXMLLoader don't work, because an NPE is thrown as soon as new FXMLLoader() (with or without parameters), or FXMLLoader.load(), is called.
I'm using 64-bit Java 7u67.
The stack trace shows:
java.lang.NullPointerException at javafx.fxml.JavaFXBuilderFactory.(JavaFXBuilderFactory.java:85) at javafx.fxml.JavaFXBuilderFactory.(JavaFXBuilderFactory.java:53) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2782) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2771)
Prior to inserting a PreLoader, a initializing class does its work and then calls the main() method of the actual application. It's basically the same thing in the Preloader, where the application's main() method is called under the Preloader's start() method.
I'm stumped as to what's the cause. Any ideas?