I have a JTable
where one column has a row-unique list of items with a JComboBox editor. (There are no event listeners involved.) The problem is that the cells are not displaying JComboBoxes, but just as JLabel
s of the underlying list's toString
. I have a class that implements TableModel
which on isCellEditable
returns true for that column. Rhe cells do not respond to the mouse.
I have tried having getColumnClass
return both JComboBox
and the class of the underlying list, and in both cases I still just get the list's toString
. I haven't made much headway in trying to make my own renderer because 1. The Oracle tutorial "How to Use Tables" is one of the most incomprehensible programming web pages ever written, and 2. I strongly suspect that I am "doing it wrong" since surely swing already knows how to render a JComboBox
of String
s. Doesn't it?
The desired behavior is that they appear to be JComboBox
es and can be edited with the mouse. I sense I should be posting more details but I don't know what I should be posting. Thanks in advance.