title: Multiple Boolean Binding in JavaFX
body: <p>I am attempting to bind a checkbox to multiple checkbox as seen below:</p>
  
  <pre><code>private void bindPanelToPackages(CheckBox panel, CheckBox ...pkg){
  
      BooleanProperty panelBinding = null;
      BooleanBinding binder = null;
  
      for(CheckBox p: pkg){
          if(panelBinding == null){
              panelBinding = p.selectedProperty();
          }
          else{
              binder = panelBinding.and(p.selectedProperty());
          }
      }
  
      if(binder != null){
          panel.selectedProperty().bind(binder);
      }
      else if(panelBinding != null){
          panel.selectedProperty().bindBidirectional(panelBinding);
      }
  }
  </code></pre>
  
  <p>What I want is to allow bidirectional group bindings when 'pkg' has more than one item. That way when I select my packages, the 'panel' will automatically be selected or if I select 'panel', all the 'pkg' will be selected/deselected. I got stuck at : </p>
  
  <blockquote>
    <p>panel.selectedProperty().bind(binder);</p>
  </blockquote>
  
  <p>and got</p>
  
  <blockquote>
    <p>"JavaFX Application Thread" java.lang.RuntimeException: CheckBox.selected : A bound value cannot be set.</p>
  </blockquote>
  
  <p>since I did a one directional binding for 'binder'. Is there a way I can perform something equivalent to this?: </p>
  
  <blockquote>
    <p>panel.selectedProperty().bindBidirectional(binder);</p>
  </blockquote>
  
  <p>I can't seem to find it in the docs or I'm not looking at the right places. Thanks!</p>