posted 7 years ago
Hello,
I know the below code it not very optimized but the main problem I am having is with the combobox when I try to delete the first item. The combobox is set to -1 and I receive an Array Index Out Of Bounds Exception due to this line: selection = songList.get(index). I can change the index to equal 0 if t's -1 but then all items from the combobox are removed for some reason. I have tried several revisions to address this but I cannot seem to figure out how best to approach this, so I was wondering if anyone might have any suggestions. Thanks in advance for any recommendations.
FYI, I have a separate Song class and a separate class that extends JFrame that is not posted.