I am following the zetcode Snake java games tutorial and always get this error:
ImageIcon iid = new ImageIcon(this.getClass().getResource(\"ball.png\")); bal
if the resource is in your classpath then you should be trying "this.getClass().getClassLoader().getResource("ball.png")". For you actual code to work, the ball.png needs to be in the location where your .class file is (i.e., inside the package).