import javax.swing.*; import javax.swing.table.*; import java.util.*; import java.awt.*; import java.awt.event.*; import com.zfqjava.swing.*; import com.zfqjava.swing.cell.*; public class CellEditorDemo extends JDataGridBean { public CellEditorDemo() { super(); configure(); } private void configure() { JDataGrid dataGrid = getDataGrid(); ((BooleanCellEditor)dataGrid.getCellManager().getCellEditor(Boolean.class)).setComponentType(BooleanCellEditor.CHECK_BOX); // ((BooleanCellEditor)dataGrid.getCellManager().getCellEditor(Boolean.class)).setComponentType(BooleanCellEditor.COMBO_BOX); ((BooleanCellRenderer)dataGrid.getCellManager().getCellRenderer(Boolean.class)).setComponentType(BooleanCellRenderer.CHECK_BOX); DataGridModel model = (DataGridModel)dataGrid.getModel(); model.setColumnName("Boolean", 0); model.setColumnClass(Boolean.class, 0); } public static void main(String[] args) { final CellEditorDemo demo = new CellEditorDemo(); demo.setDefaultCloseOperation(JBean.EXIT_ON_CLOSE); SwingUtilities.invokeLater(new Runnable() { public void run() { demo.showFrame(); demo.getDataGrid().requestFocus(); } }); } }