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

后端 未结 4 559
感动是毒
感动是毒 2021-01-28 03:50

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

4条回答
  •  情深已故
    2021-01-28 04:30

    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...

提交回复
热议问题