It took me very little effort to put a JComboBox in a JTable so that when the cells in a certain column are clicked, it lets the user choose from a drop down list of items. However, my program requires that the underlying combo box can change, since the list that the combo box relies on can change. How can I make this happen? I tried some various things, such as the following, but with no luck. Didn't really expect it to work anyway, considering the return type of getCellEditor. .
javax.swing.table.TableColumn doctorColumn = jTable1.getColumnModel().getColumn(1);
javax.swing.JComboBox box = (javax.swing.JComboBox)doctorColumn.getCellEditor();
box.removeAllItems();
java.util.Vector<Doctor> docs = Application.readDoctors();
for (Doctor d: docs){
box.addItem(d.readName().toString());
}