title: Scroll bars / scrollpane disappearing upon image upload and zoom in JavaFX
body: <p>This is a JavaFX application. There is an imageView nested inside a Scroll Pane, and before an image loads/displays, the scroll bars are visible. However, when the user uploads the image or clicks/zooms in on the image, the scroll bars disappear. This leaves only a portion of the image visible.</p>
  
  <p>I'm a very new developer so I might be using the wrong methods to resize the image. I also might be calling the method on the wrong object (in this case, the imageView itself is acted upon, not the image object painted on it).</p>
  
  <p>Here is the zoom method I built:</p>
  
  <pre><code>// a method that allows user to zoom in and out on the image
      @FXML
      private void zoomImage(MouseEvent event) {
          if (imageDisplay != null) {
              if (imageDisplay.getScaleX() == 1.0 &amp; imageDisplay.getScaleY() 
  == 1.0) {
                  imageDisplay.setScaleX(3.0);
                  imageDisplay.setScaleY(3.0);
              } else {
                  imageDisplay.setScaleX(1.0);
                  imageDisplay.setScaleY(1.0);
              }
          } else {
              return;
          }
      }
  </code></pre>
  
  <p>(Here is the FXML for the imageView and Scroll Pane, both of which are in a VBox)</p>
  
  <pre><code>&lt;ScrollPane&gt;
      &lt;content&gt;
           &lt;ImageView fx:id="imageDisplay" fitHeight="300.0" fitWidth="650.0" 
  onDragDropped="#handleImageDrop" onDragOver="#handleImageDrag" 
  onMouseClicked="#zoomImage" pickOnBounds="true" preserveRatio="true" /&gt;
      &lt;/content&gt;
  &lt;/ScrollPane&gt;
  </code></pre>
  
  <p>I expect the scroll bars to remain visible after the image is uploaded and zoomed in. </p>