I am following the zetcode Snake java games tutorial and always get this error:
ImageIcon iid = new ImageIcon(this.getClass().getResource(\"ball.png\"));
bal
You can use only path of your image. I think this will help you: Use this:
ImageIcon iid = new ImageIcon("C:\\Users\\ranig\\My\\spaceinvaders\\ball.png");
Note: C:\\Users\\ranig\\My\\spaceinvaders\\ball.png is the whole path of ball.png image.
instead of this:
ImageIcon iid = new ImageIcon(this.getClass().getResource("ball.png"));
Note: If u want to only try snake code and only want to get output.