title: Importing Images Into Eclipse
body: <p>I'm trying to import images into my eclipse project. Right now, to assign an image to a BufferedImage I'm using:</p>
  
  <pre><code>try{
              player = ImageIO.read(new File(javax.swing.filechooser.FileSystemView.getFileSystemView().getHomeDirectory() + "\\"));
          } catch (Exception e){
              e.printStackTrace();
          }
  </code></pre>
  
  <p>I have to get the path of the users Desktop, and the user of the game has to put the game and the images on their desktop, and it's just very annoying.</p>
  
  <p>Question - How can I import an image into my eclipse project so I can just use:</p>
  
  <p>new File("filename.png");</p>
  
  <p>and the image will export with the project jar, and still work?</p>
  
  <p>Note - I'm tried this in the past by putting the image into the src folder or the Project folder, but I think I broke something in my Eclipse where it's not recognizing pngs as pngs. </p>