Could someone tell me how to get the selected item of JList to a String? It is a single selection JList.
JList
String
The answers given above doesn't work or are not so advanced as on today. The following code could be used inside the ListSelectionEvent.
String selected = jList1.getSelectedValue().toString(); jTextArea1.append("Selected item is " + selected);