List<String> array in JComboBox

帅比萌擦擦* 提交于 2019-12-08 11:58:58

问题


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.


回答1:


combo.addItem(s);



来源:https://stackoverflow.com/questions/4642698/liststring-array-in-jcombobox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!