user3042022
user3042022

Reputation: 87

Retrieving information from java scroll list

I was wondering how I were to do if I wanted to retrieve the chosen answer from a java scroll list (JScrollPane), and then display it in a JOptionPane.showMessageDialog? For example I would use gettext() if I wanted to get it from a textarea/box, but how do I retrieve the answer from a java scroll list?

Thanks.

Upvotes: 1

Views: 38

Answers (1)

Jordan.J.D
Jordan.J.D

Reputation: 8113

Have you tried using getSelectedValuesList() which returns a list of all selected items.

Documentation

Upvotes: 1

Related Questions