0
根据他们在JComboBox中选择的内容我希望JList显示不同的字符串,但不知道如何重新填充JList。在搜索API时,仍然没有发现任何东西。在ActionListener事件上重新填充JList
有关如何编码的任何想法?
我使用NetBeans的方式作为参考。
根据他们在JComboBox中选择的内容我希望JList显示不同的字符串,但不知道如何重新填充JList。在搜索API时,仍然没有发现任何东西。在ActionListener事件上重新填充JList
有关如何编码的任何想法?
我使用NetBeans的方式作为参考。
不知道如何重新填充一个JList 虽然
DefaultListModel model = new DefaultListModel(...);
// add items to the model
list.setModel(model);
或者你可以使用DefaultComboBoxModel这将让你与Vector或阵列模式创建。
setListData()
方法允许您重置列表的内容。