JTable with different JComboBox-es for each row <p>I created <code>JTable</code> that contains information about employees. In this JTable I added the column called "Qualifications". This column is represented by <code>JComboBox</code> (different content at each row). For instance:</p> <pre><code>Row 1 | JComboBox(){"Programmer","Web"} Row 2 | JComboBox(){"Writer","Editor"} </code></pre> <p>The <code>JComboBox</code> content is taken from the <code>List&lt;String&gt; employees[row].getQualification()</code>.</p> <p>The problem is that the selected item in Row 1 and Row 2 is "Programmer", however "Programmer" should not appear in Row 2. Only when I click on <code>JComboBox</code>, the correct list appears, i.e. Row 2 - {"Writer","Editor"}.</p> <pre><code> TableColumn column = table.getColumnModel().getColumn(5); column.setCellRenderer(getRenderer()); private TableCellRenderer getRenderer() { return new TableCellRenderer() { private JComboBox&lt;String&gt; box = new JComboBox&lt;String&gt;(); @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { for (String q : employees[row].getQualification()) box.addItem(q); box.setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); box.setForeground(isSelected ? table.getSelectionForeground() : table.getForeground()); return box; } }; } </code></pre>