简体   繁体   中英

Java - JList see if ANYTHING is selected

如何检查用户是否在JList中选择了任何内容?

您是否尝试过JList.isSelectionEmpty()

It's not optimal, but...

Create a deep copy of the list before it gets changed. Then compare (using equals) the possibly changed list to the copy of the original.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM