Sorry, that's not right, and it's pretty easy to test, which we should have done sooner.
I create a project in eclipse. In the src directoy, I put an image file named Duke.png. I also create a...
Type: Posts; User: KevinWorkman
Sorry, that's not right, and it's pretty easy to test, which we should have done sooner.
I create a project in eclipse. In the src directoy, I put an image file named Duke.png. I also create a...
I'm not convinced the URLs were ever really your actual problem- I think your problem was confusing absolute and relative paths. Anything that starts with a / is an absolute path. Plus the...
Capitalization doesn't matter on linux; it does on Windows. Not sure about mac.
But reading aussiemcgr's advice makes sense. Either try his approach or use the getResourceAsStream() method.
Can you take a screenshot of your directory hierarchy in eclipse so we know exactly where everything is located?
If your multimedia folder is indeed inside your src folder, and that multimedia...
Try changing this line:
this.getClass().getResource(iconName);
To this:
this.getClass().getClassLoader().getResource(iconName);
Your jar doesn't have a bin folder. It doesn't have anything above the src folder. So using ../multimedia doesn't really make any sense in the jar.
You're calling the method correctly. It's...
Here's the easiest way to accomplish this:
Step 1: Put your multimedia folder inside your src folder. It should be at the same level as any packages you have declared, or any classes with the...
You can use the command prompt to view the contents of the jar: Viewing the Contents of a JAR File (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)
Are the images inside the...