This is probably unsolvable as it seems the problem is that the file "doesn't exist" yet I checked and it does, but for some reason my Image variable "ground" is always null. I put in the correct filepath, yet it is still null. I put a try/catch block yet nothing seems to happen. I am new to Java, and do not understand why this is happening.
The error I get:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "java.awt.image.BufferedImage.getSubimage(int, int, int, int)" because "this.ground" is null
(Btw I can respond with the class that initializes this class, just ask because I forgot to)
Code:
#All other files can be read yet 1 cannot.
7 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @fallow crown! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Oh sorry, I don't know why it copied it without the png extension.