Any idea why?
Below is the code
Code: Select all
Image image = null;
try {
URL imageUrl = new ClassPathResource("some_chart_bg.png").getURL();
image = Toolkit.getDefaultToolkit().getImage(imageUrl);
} catch (IOException e) {
logger.error("could not get image for chart bg", e);
}
if(image!=null){
plot.setBackgroundImage(image);
plot.setBackgroundAlpha(0.2F);
}else{
logger.debug("Image was null");
}