-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hi, I have a listbox and I want to fill it with images,
it has been filled by icons names but the images will not be displayed
knowing that I get these images from a local folder.
in environnement.properties i do:
iconDirectory=D:/workspace/myProject/icons/
in java i do:
public void appendList(){
File f = new File(System.getProperty("iconDirectory")+folderName);
if(f.exists()){
File[] files = f.listFiles();
for (int i = 0; i < files.length; ++i) {
File ico = files;
Listitem item = new Listitem(ico.getName());
item.setImage(ico.getName());
item.setValue(ico.getName());
list.appendChild(item);
}
list.setSelectedIndex(0);
}
}
I spent a long time here, and I have not found a solution
Please help me? Thanks in advance.
Create a ListitemRenderer
Asked: 2010-05-12 06:54:45 +0800
Seen: 102 times
Last updated: May 12 '10