I think you should change:BufferedImage[] sprites = new BufferedImage[rows * columns];for: BufferedImage[] sprites;

And then in the constructor add:sprites = new BufferedImage[rows * columns];

Because when you say BufferedImage[] sprites = new BufferedImage[rows * columns];, rows and columns are 0. Then you change their values in the constructor, but sprite is already created with 0 for rown and colums, I think that's the problem

If you learn to use a debugger, it is only too easy to spot these kind of things yourself. Just set a breakpoint in the constructor on the line that breaks and investigate the state of the object; it should be pretty obvious when member variables are 0 when they really shouldn't be

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org