title: How to set image to a scene background in JavaFX?
body: <p>The title says it all, I guess.</p>
  
  <p>How to set a <code>.jpg</code> (or any other supported image format) image to a Scene background?</p>
  
  <p>I <em>somewhat</em> achieved this by using a <code>HBox</code>, an <code>Image</code> and an <code>ImageView</code>, like this:</p>
  
  <pre><code>String url = ...
  HBox box= new HBox();
  Image x = new Image(url);
  ImageView iv = new ImageView(x);
  box.getChildren().add(iv);
  box.setVisible(true);
  </code></pre>
  
  <p>Then I add that box to the Scene first, and everything else afterwards.</p>
  
  <p>I'm not complaining about that piece of code - it works for my purposes - but is there a proper way to set a background?</p>