I have read countless tutorials on how to do this yet I am still stuck
I think the problem is that most tutorials are manually drawing their Lists
I have a JFrame with a JList dragged onto it (I am using Netbeans)
I want to press one button to add to the list box and one to delete (delete the item selected)
I have tried using getSelectedIndex etc
But it doesn't delete anything and a lot of errors occur in the Output console
I have seen a lot of mention of something like DefaultListModel or something named similar
Where can I be going wrong, there isn't even a remove option like most tutorials say. Let me repeat for clarities sake I am a newb I only started using this program 2 weeks ago but I know that I don't want to draw a New list box in another form
I have the same problem too, I read that I should use Array of items then use add(array) to add to the list. I tried it but it's not working also I read about DefaultListModel and tried it and stills the item is not added to the list.
what is the difference between the two ways of adding to the JList?
first, obviously you set the values into the list... and it exactly shows the consequences depends on how had you arrange them accordingly.... right?
for example, i have
deftones, El Nino, Underground, hardcore
Well, you can put it in the list....
What if i like to delete El Nino?
Then, delete El Nino,
Replace all the values from the list and put this again,
deftones, Underground, hardcore
correct me if im wrong,