title: Updating ImageViews within a TilePane with JavaFX (Simple Reference Problem?)
body: <p>Currently, I am trying to update the ImageViews within each Tile of a TilePane.</p>
  
  <p>Variable at top of class available to all methods: <code>ImageView imgArray[] = new ImageView[20];</code></p>
  
  <p>Creating the original TilePane:</p>
  
  <pre><code>public TilePane createTilePane() {
      TilePane tile = new TilePane();
      tile.setPrefColumns(5);
      for (int i = 0; i &lt; 20; i++) {
          tile.getChildren().add(this.createImageView("https://media.forgecdn.net/avatars/141/115/636539774401917932.jpeg", i));
      } //for
      return tile;
  } //createTilePane()
  
  public ImageView createImageView(String url, int x) {
      Image image = new Image(url);
  
      imgArray[x] = new ImageView();
  
      imgArray[x].setImage(image);
      imgArray[x].setFitWidth(100.0);
      imgArray[x].setFitHeight(100.0);
      imgArray[x].setImage(image);
  
      return imgArray[x];
  } //createImageView()
  </code></pre>
  
  <p>The problem is whenever I want to change an image within the tilepane I can't. For example I want to be able to do: <code>this.createImageView("url", 2);</code> to change a Tile within the TilePane.</p>
  
  <p>I can do that with no errors, but the image is not changing.</p>
  
  <p>Any ideas?</p>