I have two JList on a swing GUI. Now I want that when a user clicks on a button (say TransferButton) the selected elements from one JList is added from the first JList to the second JList and remove those selected elements from the first JList.
Share
The model doesn’t know about selection.
The JList provides several methods to get the selected item or selected index. Use those methods to get the items and add them to the other list’s model.