private void addCheckboxCellEditor(boolean defaultValue, int rowIndex, int columnIndex) { JCheckBox checkBox = new JCheckBox(); checkBox.setHorizontalAlignment(JLabel.CENTER); checkBox.setSelected(defaultValue); table.setCellEditor(rowIndex, columnIndex, new DefaultCellEditor(checkBox)); table.setCellRenderer(rowIndex, columnIndex, CHECKBOX_RENDERER); }
private void addCheckboxCellEditor(boolean defaultValue, int rowIndex, int columnIndex, AdvancedJTable table) { JCheckBox checkBox = new JCheckBox(); checkBox.setHorizontalAlignment(JLabel.CENTER); checkBox.setSelected(defaultValue); table.setCellEditor(rowIndex, columnIndex, new DefaultCellEditor(checkBox)); table.setCellRenderer(rowIndex, columnIndex, new CheckBoxRenderer()); }