title: cant load image with JFileDialog
body: <p>was initially using jfilechooser to upload jpg files into project but switched to jFileDialog because I wanted to get the images in thumbnail view. but when I run the project, I get this error msg:<br/></p>
  
  <pre><code>javax.imageio.IIOException:Cant read input file!
  </code></pre>
  
  <p>this is the code below:
  <br/></p>
  
  <pre><code>FileDialog fd = new FileDialog(this,"Choose a File",FileDialog.LOAD); 
      fd.setDirectory("C:\\");
      fd.setFile("*.jpg;*.jpeg");
      fd.setVisible(true);  
      filename = fd.getFile();
      if(filename==null){
      }else{
      try{
              File imgs =new File(filename);
              BufferedImage bufferedimage=ImageIO.read(imgs);
              BufferedImage thumbnail=Thumbnails.of(bufferedimage)
              .size(145, 141)
              .asBufferedImage();
              ByteArrayOutputStream os = new  ByteArrayOutputStream();
              ImageIO.write(thumbnail,"jpeg", os);
              InputStream is=new ByteArrayInputStream(os.toByteArray());
              ByteArrayOutputStream bos = new  ByteArrayOutputStream();
              byte[] buf =new byte[1024];
              try{
                  for(int readNum; (readNum=is.read(buf))!=-1;){
                      bos.write(buf,0,readNum);
                      System.out.println("Read" +readNum+ "bytes,");
                  }
              }catch(IOException ex){
                  Logger.getLogger(null);
              }
              person_image=bos.toByteArray();
          }catch(Exception e){
              JOptionPane.showMessageDialog(null, e);
          }finally{
              try{
                  rs.close();
                  pst.close();
              }
              catch(Exception e){
              }
          }
  </code></pre>
  
  <p>I think the problem is coming from this section: <br/></p>
  
  <pre><code>File imgs =new File(filename);
  BufferedImage bufferedimage=ImageIO.read(imgs);
  </code></pre>
  
  <p>it doesn't seem to get the file. please what am I doing wrong?</p>