private void updateButtonStates() { Platform.runLater( () -> { final Account account = selectedAccountProperty.get(); if (account != null) { final int count = account.getTransactionCount(); deleteButton.setDisable(count > 0 || account.getChildCount() > 0); reconcileButton.setDisable(count <= 0); zoomButton.setDisable(account.isPlaceHolder()); } else { deleteButton.setDisable(true); reconcileButton.setDisable(true); zoomButton.setDisable(true); } }); }