How to move an item from one list/arraylist to another list/arraylist?
Here's what I am required to do
- Add songs from a text field to a music library
ArrayList. - Select songs in the List Box and add them to the Playlist.
- Select songs in the Playlist List Box and remove them from the Playlist.
- Sort the songs in the Playlist.
I finally figured out how to add items to an arraylist and display them in a listbox. Now I need to know how to select them and move them to another list/array using a button.
Any ideas?
ListModelwhich uses yourListas it's data source. The code your teacher gave is for working withLists from the collections API, notJList. You may also want to check out How to use lists for more details