I know this is a simple question, but either nobody is explaining it right, or my eclipse/JDK is broke. I am following a tutorial at: http://zetcode.com/tutorials/javagamestutorial/animation/
In it, I place a star png on the screen and animate it. When I use:
ImageIcon ii = new ImageIcon(this.getClass().getResource("star.png"));
It gives me a null pointer exception. currently I have the star.png file in the same folder as the class that is calling for it (I know that is not best practice in general, but I'm just doing what this tutorial says just to follow it.
I know this question is an exact dublicate (same tutorial even), but there is no answer, and it is not working for me no matter where I put this file. getResource() -> Source not found
I am using eclipse as my idea on here as well, do I have to do something else to make the idea realize that this is a resource for the project or something?