I am following the zetcode Snake java games tutorial and always get this error:
ImageIcon iid = new ImageIcon(this.getClass().getResource(\"ball.png\"));
bal
I will make it simple for you . Here is an example:
Icon bug = new ImageIcon(getClass().getResource("bug1.png"));
here "bug1.png" is the resource and if it is unavailable then it can cause error as you have discussed here.
Import an image to the same directory in which your program resides.
You can also give whole path to it as well
ImageIcon(getClass().getResource("C://me/file/bug1.png"));