pictures may be null, it happens on I/O error or more typically if the File on which you invoke listFiles() is not a directory or doesn't exist.

February 28th, 2014, 07:49 AM

redstripes

Re: "Exception in thread "main" java.lang.NullPointerException" help?

I still don't get how I can fix the problem?

February 28th, 2014, 07:59 AM

Norm

Re: "Exception in thread "main" java.lang.NullPointerException" help?

First you need to find the variable with the null value. Add a println() statement that prints out the value of all the variables on line 49.
When you know what variable, then work of finding why it does not have a valid value.