code: @PostConstruct
      public void init() {
  
          bindAction(burger1);
          bindAction(burger2);
          bindAction(burger3);
          bindAction(burger4);
  
          snackbar = new JFXSnackbar(root);
          snackbar.setPrefWidth(300);
  
          badge1.setOnMouseClicked((click) -> {
              int value = Integer.parseInt(badge1.getText());
              if (click.getButton() == MouseButton.PRIMARY) {
                  value++;
              } else if (click.getButton() == MouseButton.SECONDARY) {
                  value--;
              }
  
              if (value == 0) {
                  badge1.setEnabled(false);
              } else {
                  badge1.setEnabled(true);
              }
              badge1.setText(String.valueOf(value));
  
              // trigger snackbar
              if (count++ % 2 == 0) {
                  snackbar.fireEvent(new SnackbarEvent(new JFXSnackbarLayout("Toast Message " + count)));
              } else {
                  if (count % 4 == 0) {
                      JFXButton button = new JFXButton("CLOSE");
                      button.setOnAction(action -> snackbar.close());
                      snackbar.fireEvent(new SnackbarEvent(
                          new JFXSnackbarLayout("Snackbar Message Persistent " + count, "CLOSE", action -> snackbar.close()),
                          Duration.INDEFINITE, null));
  
                  } else {
                      snackbar.fireEvent(new SnackbarEvent(
                          new JFXSnackbarLayout("Snackbar Message" + count, "UNDO", null),
                          Duration.millis(3000), null));
                  }
              }
          }
docs: init fxml when loaded.