bp.setStyle("-fx-padding: 10;");
choiceBox.getItems().addAll("Inline skin", "Default skin");
bp.setTop(choiceBox);
title.setFont(Font.font(24));
FXForm form = new FXFormBuilder<>()
.includeAndReorder("firstName", "lastName", "age", "favoriteMovie", "coolDeveloper")
.resourceBundle(Utils.SAMPLE)
.build();
form.setSource(user);
box.getChildren().addAll(title, form);
choiceBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observableValue, String s, String s2) {
if (s2.equals("Inline skin")) {
title.setText("Inline skin");
form.setSkin(new InlineSkin(form));
} else {
title.setText("Default skin");
form.setSkin(new DefaultSkin(form));
}
}
});
bp.setCenter(box);
choiceBox.getSelectionModel().selectFirst();