I have a method for removing an object from a list, this is used to create listView, so the object is deleted using the index of the element listView. But I want this method to work for several types of objects, i.e. I have more than one listView.
public void removeFromList(ListView<Label> listView, ArrayList<objects?> arrayList){
int minus = listView.getSelectionModel().getSelectedIndex();
arrayList.remove(minus);
listView.getItems().remove(minus);
}
source
share