Java JTable with JComboBox
I'm trying to place a JComboBox inside a certain column of a JTable. I have this code, and it is working: model = new DefaultTableModel(); JComboBox<String> optionComboCell = new JComboBox<String>(); optionComboCell.addItem("Option 1"); optionComboCell.addItem("Option 2"); optionComboCell.setSelectedIndex(1); table = new JTable(model); // Adding here all the columns, removed for clarity model.addColumn("Options"); TableColumn optionsColumn = table.getColumn("Options"); optionsColumn.setCellEditor(new DefaultCellEditor(optionComboCell)); My problem with this, is that it doesn't show as