Okay, I re-read the links. I think I have figured it out.
I put this code just before I used ImageIO.read() to get the resource URLs.
1 2 3 4 5
| Enumeration<URL> urls = this.getClass().getClassLoader().getResources(filename); for (URL url = null; urls.hasMoreElements();) { url = urls.nextElement(); System.out.println(url.toString()); } |
What it does is, it outputs only 4 image URLs, when it should have been 5 image URLs. I went and check the file path in the source codes first, then commented out any references to the fifth image URL. Finally, I did an export of my project.
The result is a success.

Now, I was curious as to why it's not working before, so I went and check the resource file. Lo and behold, the resource file had a file extension name in all capital letters. (It should be ".png", but it was ".PNG".) The moment I saw it, I realized what it was: corrupted file.
I went ahead and fix the corrupted file by reloading/resaving/overwriting over the file with a fresh copy. Then uncomment the references I had in my source code. Debugged to check to see if everything is okay. Finally, re-export the project as a runnable JAR.
The result is now a success.


You can actually tell what I did. Problem solved.
