我有这个字段:
HashMap<String, HashMap> selects = new HashMap<String, HashMap>();
对于每个Hash<String, HashMap>
我需要创建一个ComboBox
,其项是以下值(恰好是 HashMap 本身)HashMap <String, **HashMap**>
.
通过(非功能性)演示:
for (int i=0; i < selects.size(); i++) {
HashMap h = selects[i].getValue();
ComboBox cb = new ComboBox();
for (int y=0; y < h.size(); i++) {
cb.items.add(h[y].getValue);
}
}
我知道我有点晚了,但我也会分享我所做的事情,以防对其他人有帮助:
HashMap<String, HashMap> selects = new HashMap<String, HashMap>();
for(Map.Entry<String, HashMap> entry : selects.entrySet()) {
String key = entry.getKey();
HashMap value = entry.getValue();
// do what you have to do here
// In your case, another loop.
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)