title: Using URL or File (in ImageIO.read)
body: <p>I made an application that uses several images. I have 2 ways to run my app:<br/>
  - press <code>run</code> in idea <br/>
  - make a fat jar file and run it from console <code>java -jar app.jar</code><br/></p>
  
  <p>If I want to run it from <code>Idea</code> I have to use:<br/></p>
  
  <p><code>BufferedImage backgroundImage = ImageIO.read(new File("res/field.png"));</code><br/></p>
  
  <p>instead of </p>
  
  <p><code>BufferedImage backgroundImage = ImageIO.read(getClass().getClassLoader().getResource("res/field.png"));</code><br/>
  &lt;- that's what I have to use in jar file case</p>
  
  <p>Why? I thought that they're about the same. Is there any universal way for my case?</p>