I have recently installed the new Java 8u5 update so I can use lambda operations and the new Scene Builder, however I immediately had problems loading the FXML documents. Before I did it in a different thread and used Platform.runLater(...) to load using the FXMLLoader
. However this did not work so I put it on the JavaFX application thread like this:
ready.addListener((ObservableValue<? extends Boolean> ov, Boolean t, Boolean t1) -> {
if (Boolean.TRUE.equals(t1)) {
Platform.runLater(() -> {
try {
//skipped loading the other FXML documents for this post...
final FXMLLoader load = new FXMLLoader(guiResource);
final GUIController guiController = new GUIController();
load.setController(guiController);
scene = new Scene((AnchorPane) load.load());
stage.setScene(scene);
} catch (IOException ex) {
Util.err(ex.getLocalizedMessage());
}
stage.show();
});
}
}
However I am still getting this rather unhelpful post in the netbeans console:
file:/C:/Users/Blah/path/to/my/Application.jar!/resources/GUI2.fxml
That is all it says. Has anyone else had this problem? What does this mean? Why is there an exclamation mark after the .jar?
I thought the problem might have something to do with my variable declarations in the controller so here is an example:
@FXML
Region fileImportVeil;
@FXML
ProgressIndicator fileImportProgressIndicator;
Am I mean to put private
in front of all of my FXML fields?