<p>When running a Java app from eclipse my ImageIcon shows up just fine.</p>

<p>But after creating a jar the path to the image obviously gets screwed up.</p>

<p>Is there a way to extract an image from the jar at runtime so I can then open it up?  Or, is there a better way to do this?</p>

<p>I'd like to distribute a single jar file if possible.</p>

You can try something like:
```
```
InputStream stream = this.getClass().getClassLoader().getResourceAsStream("/images/image.jpg");
```
```
In your JAR file, you might have a directory structure of:
MyJAR.jar
- com (class files in here)
- images
----image.jpg