I'm writing a simple program that has a number of different labels where I display images (jpgs). The program allows you to choose a directory with pictures in it and then click a menu item to read that directory and load a single picture in each label. That part works. However, I also have a button within each JPanel (that holds each JLabel that holds the image) that, when you click on it, should move the picture from one directory to another. However, that's the part that doesn't work. Here are some code bits (figured that would be easier than posting the full code but please tell me if it's best to do otherwise:
Declares variable pictureNamesArrayList within the class itself so I can access it anywhere in the program (at least that was my intention)
Constructor ..
Then code to create the JPanels to hold to pictures and buttons I want:
Code that executes when the "Load" menu item is chosen. This works so I know pictureNamesArrayList is getting loaded correctly and has values in it at this point
Lastly, the code called when the "Archive" button is clicked and the part that is returning the following error: Exception in
thread "AWT-EventQueue-0" java.lang.NullPointerException
I looked up what the error means and found that it means
Java is pointing to a Null. I'm assuming that is the pictureNamesArrayList at this point but I can't figure out what it is null. Any help would be appreciated.