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.
是的,将值设置为 JList,知道这一点。但我想知道是否有一种简单的方法来实现自定义 JList,在该 JList 上 setSelectedValue() 不会引发事件以通知附加的侦听器。我想保持安静:)。
实现一个javax.swing.ListSelectionModel不触发事件的自定义并将一个实例分配给您的javax.swing.JList.
javax.swing.ListSelectionModel
javax.swing.JList