清单<串GT;数组中的JComboBox [英] List<String> array in JComboBox

查看:184
本文介绍了清单<串GT;数组中的JComboBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个JComboBox,已经创建了,但我想以更新列表阵列的数据信息。

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

我目前拥有的code:

I currently have the code:

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);
}

这code没有工作。

任何人都可以点我在这里正确的方向?

Can anyone point me in the right direction here?

感谢。

推荐答案

组合。<一个href=\"http://download.oracle.com/javase/6/docs/api/javax/swing/JComboBox.html#addItem%28java.lang.Object%29\"相对=nofollow>的addItem (S);

这篇关于清单&LT;串GT;数组中的JComboBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆