我正在尝试在表格的列中放置一个复选框...但是我显示布尔值,当我单击单元格时,它会显示复选框并很快显示布尔值...
public class Tabela {
private JTable tabela;
private JCheckBox checkbox;
public Tabela(Object[][] linhas, String[] nomeColunas) {
this.tabela = new JTable();
this.tabela.setModel(new DefaultTableModel(linhas, nomeColunas));
this.checkbox = new JCheckBox();
this.tabela.setFillsViewportHeight(true);
this.tabela.getColumn("Selecione").setCellEditor(
new DefaultCellEditor(checkbox));
}
public JTable getTabela() {
return tabela;
}
}
那么我的代码有什么问题?
我创建了分离的表格、表格和面板......