How to delete an Object from a file ??
DefaultListModel model = (DefaultListModel) list.getModel();
int selectedIndex = list.getSelectedIndex();
if (selectedIndex != -1) {
model.removeElement(list.getSelectedValue());
}
with this code I am able to delete only from the list. Is there a code to remove object from the list and file ?