I am quite new to programming, at least on the level that I am currently attempting. I've been creating a character class for use in a 2D fighting game engine that will hold a BufferedImage arraylist of frames of character animation. Everything in the program compiles and runs fine, except that I keep running into a NullPointerException in the following code:
public void addImage(String image) throws IOException
{
this.character.add(ImageIO.read(new File(image)));
}
I am not sure exactly how to fix this, as my low level of general Java knowledge (I only have 1 2 semester high school class by a shoddy teacher under my belt) prevents me from correctly understanding the descriptions on how to fix the problem on various websites. Could somebody describe how to solve this in a clean and concise way? Thank you!