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 中获取选定元素的数量?这样我就可以创建一个 int[] 数组并将选定的索引添加到该数组中。
JList.getSelectedIndices().length 会给你数组长度:) 参考 Javadocs mate