Sandeep Bansal
Sandeep Bansal

Reputation: 6394

List<String> array in JComboBox

I have a JComboBox already created but I would like to update the information with data from a List Array.

I currently have the code:

java.util.List<String> listNames = empPort.getEmployeeInfo("username");
int itemSize = listNames.size();

the empPort is directed to a web service operation which returned a set of values in a List Array.

When using;

for(String s : listNames)
{
    combo.add(s, combo);
}

This code did not work.

Can anyone point me in the right direction here?

Thanks.

Upvotes: 0

Views: 6429

Answers (1)

Eternal Noob
Eternal Noob

Reputation: 2807

combo.addItem(s);

Upvotes: 2

Related Questions