setting backgroundImage in a Struts application

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
lia
Posts: 18
Joined: Sat Oct 14, 2006 5:02 am
Location: Victoria BC

setting backgroundImage in a Struts application

Post by lia » Sat Nov 25, 2006 12:43 am

I am trying to use an image for my chart background. I am able to get the JFreeChart.INFO.getLogo() to display, however the following code produces no image, the output says the image is NOT null and the height is -1. Does anyone know how to get a web application to do this??

ImageIcon imageIcon = new ImageIcon("products.gif");
if(imageIcon != null){
log.debug("image is NOT null");
int h = imageIcon.getIconHeight();
log.debug("image height is " + h);
Image image = imageIcon.getImage();
plot.setBackgroundImage(image);

}else{
log.debug("image is null");
}

lia
Posts: 18
Joined: Sat Oct 14, 2006 5:02 am
Location: Victoria BC

Post by lia » Sat Nov 25, 2006 5:18 pm

I figured it out. I put the image in a jar file and it worked.

Post Reply