Random null pointer problems when saving charts to disk
Posted: Sun Sep 16, 2012 9:51 am
Hi,
I am using the screenimage.java (available on source forge I believe) file to help me save some jfreecharts to disk but occasionally I get a null pointer problem when trying to do so.
I do not use the default jfreechart saving feature as I am saving multiple charts at once, all encapsulated in a jpanel.
The null pointer problem always occurs at the Paint() method of the graphics2d object in screenimage. I know that the object is not null, because I have them all become visible at the start of the run, but they may or may not be visible on screen when the call occurs.
Also once it has triggered a null pointer exception, the tab showing that panel also becomes blank. I have been trying for weeks to discover the source of the problem but I have yet to find it. It is especially frustrating as it only sometimes occurs.
Any assistance would be greatly appreciated!
Thanks!
I am using the screenimage.java (available on source forge I believe) file to help me save some jfreecharts to disk but occasionally I get a null pointer problem when trying to do so.
I do not use the default jfreechart saving feature as I am saving multiple charts at once, all encapsulated in a jpanel.
The null pointer problem always occurs at the Paint() method of the graphics2d object in screenimage. I know that the object is not null, because I have them all become visible at the start of the run, but they may or may not be visible on screen when the call occurs.
Also once it has triggered a null pointer exception, the tab showing that panel also becomes blank. I have been trying for weeks to discover the source of the problem but I have yet to find it. It is especially frustrating as it only sometimes occurs.
Any assistance would be greatly appreciated!
Thanks!