-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I have a Images folder inside my WebContent folder. In there I have 1.png and 2.png. I would like to make the content of a listitem an Image so I have done this:
this.pathToImagesFolder = Sessions.getCurrent().getWebApp().getRealPath("/Images/"); Image myImage = new Image(this.pathToImagesFolder + "/1.png"); myListItem.appendChild(myImage);
However that doesn't work? Any help?
I was having hassles a while ago as there are multiple libraries within ZK and AWT that have an Image object. The correct library is: org.zkoss.zul.Image;
Tested this code and it works perfectly:
Image image = new Image(); image.setSrc("http://www.google.com/intl/en_ALL/images/srpr/logo1w.png"); winLandingUser.appendChild(image);
Asked: 2010-09-06 13:27:54 +0800
Seen: 209 times
Last updated: Sep 06 '10