So I have a JTable with check-boxes. I would like to have the check-boxes contain one image when they are \"checked\" and another image when they are \"unchecked\" (i.e., displa
Assuming that you have just a normal JTable you may set appropriate icons in renderer and editor:
public void setIcons(Jtable table, int column, Icon icon, Icon selectedIcon) {
JCheckBox cellRenderer = (JCheckBox) table.getCellRenderer(0, column);
cellRenderer.setSelectedIcon(selectedIcon);
cellRenderer.setIcon(icon);
DefaultCellEditor cellEditor = (DefaultCellEditor) table.getCellEditor(0, column);
JCheckBox editorComponent = (JCheckBox) cellEditor.getComponent();
editorComponent.setSelectedIcon(selectedIcon);
editorComponent.setIcon(icon);
}