title: How to clone a node in the scene graph in JavaFX?
body: <p>I have a HBox with prefHeight = 70 // no prefWidth or any width...</p>
  
  <p>I also have a Pane with prefWidth = 50 // no prefHeight or any height...</p>
  
  <p>I just want to add multiple instance of the pane to the HBox using some loop.</p>
  
  <p>When I do add(pane) in the loop body it gives following error.</p>
  
  <pre><code>Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: Children: duplicate children added: parent = HBox[id=myHBox]
  </code></pre>
  
  <p>I need to find way to clone the pane(as it passes by value).
  Can anybody help me please?
  (taking snapshot are not work for me because prefHeight of the pane is not set/ computed using parent)</p>