I have created a JComboBox and I am using it on a column of a JTable - see code below.
Object[] items = {"1", "2", "3", "4"}; JComboBox comboBox = new JComboBox(items); comboBox.setRenderer(new customComboBoxRenderer()); myTable.getColumnModel().getColumn(Table.CONF_COL).setCellEditor(new DefaultCellEditor(comboBox)); Now, my problem is that I cannot find a way to make each combo box in the column of the table with the combo boxes to have an initial value (might be different on each combo box) which will also be the selected item of the particular combo box when the program starts. I think the problem is being created because the JTable is using only one JComboBox instance for all the cells of the column and therefore I can never get a different instance of combo box for each of the cells on the column and set the selected item to them.
Any help would be really appreciated.
Many thanks,
Soc