I have a Jlist with 10 items (booktitles). The user will be allowed to select 3 items out of the 10. I want to save the selected items to 3 different string variables (example book0, book1, book2, etc).
I am not sure how to do this.
I have the Jlist created with 10 titles showing, and I have tried so many things but no luck.
say for example you have already defined a JList object
list.This should do it for you
the array of String
selectedItemis all you needed, you may also use an arrayList here.