I am trying to change the value of my table in Java but I cannot figure out how to do so. Based on the image below, I want to change all the column values of status to be "pending" You can refer to the code that I written (but its not working at the moment)
DefaultTableModel model = (DefaultTableModel)DispatchTable.getModel();
// Set all Status rows to pending
model.setValueAt("Dispatched", 4, model.getColumnCount());
Im not sure what I'm doing wrong here but its not allowing my application to work, I think maybe I have to create a for loop and manually change all the values in the loop? Do tell me of a solution, thank you.