Adam Cripps wrote:I want to save some preferences when the user closes the JFrame. I've implemented the WindowEvent to pick this up and set setDefaultCloseOperation(JFrame.DO_NOTHING). I'm calling the applications variable prefs.flush() which is giving the NullPointerException. I'm guessing that the nullpointerexception is thrown because I'm not actually handling the instance of jreport.prefs that I think I am. I would like some help finding out where I'm going wrong with handling the jreport.prefs instance. I declare JReport jreport in JReportFrame (which is instantiated by JReport)...
The easiest thing to do is probably to add some debugging statements to print out the contents of the possible culprits, viz:
it won't tell you
why, but it may help you to narrow down the problem.
Winston