0
I’m trying to add a column to a DefaultTableModel
, but seems to be giving some problems. Follows code!
JCheckBox jcheck;
DefaultTableModel modelo = new DefaultTableModel(null, new String[]{"Data", "Hora", "SAP", "BPCS", "Etiqueta", "Min", "Max", "MV", "Min", "Max", "T5", "Min", "Max", "TS2", "Min", "Max", "T90", "Min", "Max", "Densidade", "C-Chart", "Blooming","Aprovar"}) {
@Override
public boolean isCellEditable(int row, int col) {
return true;
}
};
jcheck = new JCheckBox();
TableColumn coluna_um = jTable1.getColumnModel().getColumn(22);
coluna_um.setCellEditor(new DefaultCellEditor(jcheck));
Someone could give a force?
It is not in the tablemodel, it serves to model data, just that. To display combo in the table, you need to create a celleditor and cellrenderer. Provide a [mcve] of your code so we can help you.
– user28595
I won’t eat :(
– Lucas16
Wait, in the title you say Combobox, but in the code is Checkbox? What component are you trying to add after all?
– user28595
It’s check, I’m going crazy already
– Lucas16