I'm having a problem with the ButtonBar in JavaFX8.
I have this part of code in an FXML file :
<ButtonBar>
<buttons>
<Button text="Précédent" ButtonBar.buttonData="BACK_PREVIOUS" />
<Button text="Suivant" ButtonBar.buttonData="NEXT_FORWARD" />
<Button text="Importer un load" ButtonBar.buttonData="LEFT" />
</buttons>
</ButtonBar>
It all works fine in the SceneBuilder, but when I load it like this (launched in eclipse) :
FXMLLoader loader = new FXMLLoader(
this.getClass().getResource("LoadSelection.fxml")
);
Pane pane = loader.load();
Scene scene = new Scene(pane);
primaryStage.setScene(scene);
primaryStage.show();
I have this Exception :
Caused by: com.sun.javafx.fxml.PropertyNotFoundException: Static property "buttonData" does not exist or is read-only.
Does anyone knows how to solve this?
Thanks
Sorry I just found the error.
I had this import in the fxml file
And, as weird as it can be, when I added
<?import javafx.scene.control.ButtonBar?>
all worked fine.