Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于 Java Swings 中的桌面应用程序,.. 假设有 3 个组合框。SELECT COUNTRY SELECT STATE SELECT CITY 如果我从国家/地区列表框中选择任何国家/地区,该州中的值将自动插入数据库值>>然后在选择州时,城市将插入城市组合框中
如果你能帮助那么请帮助我...
1.尝试创建3个ComboBox。
2.用所有国家名称静态填充第一个组合框。
3.每个国家都将映射到其州。
例如:
HashMap<"String",ArrayList<States>>();
4.一旦选择了国家,所有的国家都从数据库中取出,并插入到映射到那个国家的 ArrayList<> 中。
5.类似地,每个州都将使用 HashMap 与其城市相关联。
我建议你改写你的问题。据我了解,
我建议你使用ItemListener,itemStateChanged()。
另外,请查看处理组合框上的事件。