title: Absolute Path of a Local File Object
body: <p>so I'm looking towards porting a .jar to an executable and am cleaning my code up a bit before I do that. Right now I have the following:</p>
  
  <pre><code>BufferedImage bgImg = null;
  //Grabs the background image
      try {
          bgImg = ImageIO.read(new File(""));
      } catch (IOException e1) {
          e1.printStackTrace();
      }
  </code></pre>
  
  <p>I have several other images that I can just use:</p>
  
  <pre><code>new ImageIcon(getClass().getResource("imagename.png")));
  </code></pre>
  
  <p>However, since the former is a File object it does not take the same type of argument. I was wondering if there is something similar that I can use for that, or if there is some other way to make the File absolute so that there are no errors when porting to an executable. Thanks!</p>