title: Loading Buffered Image to JLabel in JScrollPane
body: <p>I'm Java beginner trying to load a <code>.PNG</code> 8356 x 5092 pixels into a JFrame 720 x 600.</p>
  
  <p>I can load the image but it is zoomed to the top left, wanting to make the <code>.PNG</code> fit into the JFrame and then be able to span with the mouse click and zoom with mouse scroll.</p>
  
  <p>I have been looking for answers for about 2 weeks now but no avail.
  Just wanting a good shove into the right direction...</p>
  
  <p>Cheers</p>
  
  <p><strong><em>EDIT</em></strong></p>
  
  <p>Ok I got the Image to load and scale to size by doing:</p>
  
  <pre><code>public Image ScaledImage(Image img, int w, int h) {
      BufferedImage resizedImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
      Graphics2D g2 = resizedImg.createGraphics();
      g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
      g2.drawImage(img, 0, 0, w, h, null);
      g2.dispose();
  
      return resizedImg;
  
  }
  </code></pre>
  
  <p>and passing it over to the JLabel like:</p>
  
  <pre><code>BufferedImage Map = ImageIO.read(new File(.PNG-LOCATION));
       ImageIcon icon = new ImageIcon(ScaledImage(Map, 720, 600));
              JLabel Label = new JLabel();
              Label.setIcon(icon);
  </code></pre>
  
  <p>Now just need help or guidance in zooming, click to drag</p>
  
  <p>Thanks for the help</p>