Hi, I have a JTable that contains two columns. I use a JComboBox in column 1. I follow the example in Swing Tutorial. However, i am trying to display an appropriate item among JComboBox's items for every row in JTable. I assume i have to iterate throught all rows in the table, in each row i have to extract the object in column 1 and call setSelectedItem() on this JComboBox object. However, i am not sure the way i setup the column according to the tutorial will allow me to achieve my goal. Also, how can i get the JComboBox object in a column? Thanks.
posted 14 years ago
Why do you need to call setSelectedItem. If you set the value of the cell it takes care of that for you setValueAt() method. I am not sure what problem you are having.