0

I have a combobox which I am filling with database query, my combo box must be different for each row, but when adding it, it shows me the combo box with the same data for all.

I add it with this method

CComboBox priceListVersionComboBox = new CComboBox(priceListVersion);
TableColumn col = table.getColumnModel().getColumn(COLUMN_PRICELIST);
col.setCellEditor(new DefaultCellEditor(priceListVersionComboBox));

My ComboBox It is filled by

KeyNamePair[] priceListVersion = getMPriceListVersion((Integer)table.getValueAt(i, COLUMN_PRODUCTID));

How do I add the value of the current combobox per row and the previous ones keep them?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Luis Morales
  • 136
  • 1
  • 11
  • 1
    See: https://stackoverflow.com/questions/4211452/how-to-add-unique-jcomboboxes-to-a-column-in-a-jtable-java/4211552#4211552 for one approach. – camickr Nov 12 '18 at 20:09
  • Possible duplicate of [How to add unique JComboBoxes to a column in a JTable (Java)](https://stackoverflow.com/questions/4211452/how-to-add-unique-jcomboboxes-to-a-column-in-a-jtable-java) – michaeak Nov 12 '18 at 20:24
  • No, it's not the same. There are different comboboxes created, I have a single combo box for many rows and I need that for each one depends on the row I have a specific value – Luis Morales Nov 12 '18 at 21:03

0 Answers0