code: @FXML
      void okButtonOnAction(ActionEvent event) {
          UpdateAvailableDialog t = this;
  
          okButton.setDisable(true);
          cancelButton.setText(bundle.getString("button.cancel.cancelDownload"));
  
          downloadThread = new Thread(() -> {
              try {
                  boolean res = UpdateChecker.downloadAndInstallUpdate(updateInfo, t);
                  if (res) {
                      t.hide();
                  }
              } catch (IllegalStateException | IOException e) {
                  showErrorMessage(e.getLocalizedMessage());
                  e.printStackTrace();
              }
          });
          downloadThread.start();
      }
docs: Handler for Button[fx:id="okButton"] onAction