I need help..
Whenever I'm following a tutorial, in this case, this one: Reading/Loading an Image (The Java™ Tutorials > 2D Graphics > Working with Images) , when it wants to load an image, the way the tutorials are doing it is they're loading the image from a file on the computer, how can I change the code so that it's loading the image from the actual source? Like, so I can actually pack the image into the JAR, so when I run it on a different computer, it has the image inside the JAR, and it's not trying to get it from the computer..
Hope that's not too confusing.
You just need to use relative paths, for example: 'images/someImage.png". If you are using something like netbeans or eclipse, and the 'images' folder is in the project folder and added to the IDE, then when you create a jar from the project, it will be included automatically and work just fine. If you are doing it from scratch, then you need to read the man page for jar - basically there are options that allow you to include files or even specify a special classpath!