I wrote a program on moving data from one list to another using JList. But when I move the selected data from one list to another, the previous enteries in the list to which I moving data gets overwritten by the new data.
How can I make program in which the previous enteries I made in a list doesn’t get overwritten by the new data which I try to move?
Regards
Whenever adding an element to the list, you should add it to the list model using methods like
addElement().Don’t add data to the
JListusingsetData()or similar methods.