I have a gui with an ADD, EDIT, and DELETE button. All of which are not active until you click their respective name from the menu bar. Once I click on the DELETE key in the menu, it actives my delete button fine, but when I select an object from my list (and it is highlighted in blue) and click delete button I just get an error....
Do I have to add anything to my ListSelectionListener method?
Any help?
else if (source == deleteMenuItem) {
deleteButton.setEnabled(true);
status.setText("Click the photo in the list to delete\n"
+ "Click delete when finished\n");
}
else if (source == deleteButton)
{
try{
int index = itemList.getSelectedIndex();
itemList.remove(index);
}
finally {
deleteButton.setEnabled(false);
}
}