title: How to resize image in JAVA to fit a jLabel?
body: <p>Apparently, this is my code I have been using to get image from my disks to my program.</p>
  
  <pre><code>public void getVehicleImage(){
      FileDialog fd = new FileDialog(this);
      fd.setFile("*.jpg; *.jpg; *.png; *.gif");
      fd.show();
      vehicle_path = fd.getDirectory()+fd.getFile();
      vehicleFileName.setText(vehicle_path = fd.getFile());
      vehicleImagePath.setText(vehicle_path = fd.getDirectory()+fd.getFile());
      image.setIcon(new ImageIcon(vehicle_path));
  }
  </code></pre>
  
  <p>How do I fit the image to the size of my jLabel? I have tried using the</p>
  
  <pre><code>getScaledInstance()
  </code></pre>
  
  <p>but still no good. And also I want to ask if I am using the right code on how to get Image from my disk? I kinda feel it is wrong. </p>