How to transfer selected objects from one JList to another JList in swing?

advertisements

I want to transfer the selected objects from one JList to another JList, say List1 and List2.


Start by taking a look at JList#getSelectedValuesList (or JList#getSelectedValues if you're using Java 6 or earlier)

You will then need to apply these values to the second JList's model. How you do this will depend on the model that you are already using...