title: How can I set my background Image to automatically resize with window size?
body: <p>My <code>.fxml file</code> consists of an <code>AnchorPane</code> + an <code>ImageView</code> which is the background. I tried the CSS commands </p>
  
  <pre><code>backgroundImage.setStyle("-fx-background-position: left top, center;");
  backgroundImage.setStyle("-fx-background-repeat: no-repeat;");
  backgroundImage.setStyle("-fx-background-size: cover, auto;");
  </code></pre>
  
  <p>where <code>backgroundImage</code> is the <code>fx:id</code> of the <code>ImageView</code>. But whatever I do, the Image stays the same size resulting in white bars when I resize the window. </p>