deleting all the items on any of the tableViews returns a runtime error (index out of bounds exceptions).
this is due to the following line of code in the controller classes;
for (Patient p : selectedRows)
allPatients.remove(p);
in the embolden line above, deleting rows give no issue until there is just one row left on the table.
Deleting the only remaining row in the table leaves selectedRows to be == null, hence
p cannot iterate through a null value (of rows) since the iteration is based on integer and null can't be used to perform arithmetics.
Solution to this issue should be to find a way to get the number of rows (of data) left on the table and if greater than 1,
the boldened line of code should run. else, delete all items in the table (that is, only the remaining row) using a different
line of code that is not the iteration through the selectedRows.
illustration - this is my mere thought though;
if (allPatients.getNumberOfPatients() > selectedRows.getNumberOfSelectedRows()){
for (Patient p : selectedRows)
allPatients.remove(p);
}
else allPatients.removeAllDataInTableView;