0

Filling listbox with images

asked 2010-05-12 06:54:45 +0800

rminfo gravatar image rminfo
21

updated 2010-05-12 06:55:10 +0800

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.

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2010-05-12 09:40:12 +0800

YamilBracho gravatar image YamilBracho
1722 2

Create a ListitemRenderer

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-05-12 06:54:45 +0800

Seen: 102 times

Last updated: May 12 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More