Answer:
getSelectedValue
Step-by-step explanation:
The item that is clicked in a JList can be retrieved using the getSelectedValue method of JList.
This returns the first selected value in the list. In case of list supports multi selection, it returns the value with the lowest index. In case nothing is selected in the list, getSelectedValue returns null.
The return type of this method is the same as the datatype of the contents of the list. For example, If the list contains String data , the return type will be String.