title: JavaFx: Bind TableView's and ScrollPane's scrollBars
body: <p>I'm trying to bind somehow a <code>TableView</code>'s scrolling to a <code>ScrollPane</code>'s scrolling.
  I could get a reference from both scrollbars but I couldn't bind them. 
  I found also that the values of scrollbars are different,
  the <code>TableView</code>'s scrollbar has values between 0 and 100 while the <code>Scrollpane</code>'s has values between 0 and 1. </p>
  
  <p>Here is that I've tried so far:</p>
  
  <p>How I got the reference: </p>
  
  <pre><code>private static ScrollBar getScrollBar(Control source) {
          ScrollBar scrollBar = null;
          for (Node node : source.lookupAll(".scroll-bar")) {
              if (node instanceof ScrollBar &amp;&amp; ((ScrollBar) node).getOrientation().equals(Orientation.HORIZONTAL)) {
                  scrollBar = (ScrollBar) node;
              }
          }
          return scrollBar;
  }
  </code></pre>
  
  <p>Then: </p>
  
  <pre><code>public static void bindScrollBars(ScrollPane scrollPane, TableView&lt;?&gt; table) {
          ScrollBar scrollBarPane = getScrollBar(scrollPane);
          ScrollBar scrollBarTable = getScrollBar(table);
          scrollBarPane.valueProperty().bindBidirectional(scollBarTable.valueProperty())
  }
  </code></pre>
  
  <p>This way works the binding itself but I need to bind multiplied or divided by 100 to scale them to the same level.
  If I try to add <code>.multyply(100)</code> or <code>.divide(100)</code> won't work for obvious reasons, but I have no idea how can I bind them bidirectional while scaling them to the same level or 0..100 or 0..1.
  Can you suggest any solution?</p>
  
  <p>The second question would be if I would get a solution to the previous one, then how could I bind more than two <code>Control</code>'s scrollbars? For instance if I have 4 <code>Control</code>s (ScrollPane, TableView, TreeTableView, TreeTableView), how can I ensure that all of those components' scollbars are bound to each other?</p>
  
  <p>P.S. If I try to don't use bidirectional binding just bind for example :</p>
  
  <pre><code>scrollBarPane.valueProperty().bind(scrollBarTable.valueProperty().divide(100));
  </code></pre>
  
  <p>I get a RuntimeException, with the message: <code>ScrollBar.value: A bound value cannot be set.</code></p>