列表<字符串>JComboBox 中的数组 [英] List<String> array in JComboBox
本文介绍了列表<字符串>JComboBox 中的数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经创建了一个 JComboBox,但我想用列表数组中的数据更新信息.
I have a JComboBox already created but I would like to update the information with data from a List Array.
我目前有代码:
java.util.List<String> listNames = empPort.getEmployeeInfo("username");
int itemSize = listNames.size();
empPort 指向 Web 服务操作,该操作返回列表数组中的一组值.
the empPort is directed to a web service operation which returned a set of values in a List Array.
使用时;
for(String s : listNames)
{
combo.add(s, combo);
}
此代码无效.
这里有人能指出我正确的方向吗?
Can anyone point me in the right direction here?
谢谢.
推荐答案
combo.addItem(s);
这篇关于列表<字符串>JComboBox 中的数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文