title: How can i use a control more than one time in javafx 8?
body: <p>I'm currently getting started with javafx 8 and came up with the following problem in a simple solution:</p>
  
  <p>I've different controls (<code>Button</code>), which shall appear</p>
  
  <ol>
  <li>In the main content (<strong>center</strong> of a <code>Pane</code>)</li>
  <li>In a footer (<strong>bottom</strong> of a <code>Pane</code>)</li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/QR2EQ.png" alt="concept"></p>
  
  <pre><code>Button one = new Button("1");
  Button two = new Button("2");
  Button three = new Button("3");
  
  VBox vbox = new VBox();
  vbox.getChildren().addAll(one, two, three);
  
  HBox hbox = new HBox();
  hbox.getChildren().addAll(two, three); //To clarify my problem i leave one node in vbox
  </code></pre>
  
  <p>Now it appears to happen that the last <code>.addAll()</code>, <em>deletes</em> the references in the other box.</p>
  
  <pre><code>BorderPane root = new BorderPane();
  root.setCenter(vbox);
  root.setBottom(hbox);
  </code></pre>
  
  <p>Output:</p>
  
  <p><img src="https://i.stack.imgur.com/LosvX.png" alt="gui"></p>
  
  <p>I tried (for testing) to simply reuse a button, but:</p>
  
  <pre><code>root.setCenter(one);
  root.setBottom(one);
  </code></pre>
  
  <p>results in</p>
  
  <pre><code>java.lang.reflect.InvocationTargetException
  ...
  Caused by: java.lang.RuntimeException: Exception in Application start method
  ...
  Caused by: java.lang.IllegalArgumentException: Children: duplicate children added: parent = BorderPane@1784a61
  </code></pre>
  
  <p>That made me think about the following questions:</p>
  
  <ul>
  <li>Is there a way to work around that problem, except creating new button instances?</li>
  <li><em>What</em> happens to the <code>HBox</code> and <code>VBox</code> nodes?</li>
  <li><em>Why</em> controls can't be reused?</li>
  </ul>