简体   繁体   中英

Selected value in JList

Could someone tell me how can I get amount of selected value in JList? I use MULTIPLE_INTERVAL_SELECTION in my code to select more than one value.

  1. Read the JList API
  2. There are two methods that start with getSelected...() . Pick one of the methods to use.
  3. Create a loop that iterates through all the values returned from the above method
  4. Convert each value to a number and add the number
  5. display the total value.

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