posted 23 years ago
GOT IT!
I was extending DefaultTableCellRenderer in my new class. It by default wants to render items as a JLabel. Therefore I created my class to extend JComboBox and implement TableCellRenderer and this solved my problem.
I declare myColumnRenderer at the beginning of my code and when I am building my table I set the column's cellRenderer to myColumnRender. I have also set the column's cellEditor to a JComboBox that is instantiated with an Object[] of the values I wish to display. When I build my table data I also use an Object[] that looks like the following:
I add the data as rows using the addRow(Object[]) method suppled with the DefaultTableModel. In this case I have JComboBoxes for the values "None" and this value is the first value in my JComboBoxes. This way it appears that the first item in both JComboBoxes is the initially selected item.