private void jCheckBox1MouseClicked(java.awt.event.MouseEvent evt) { // TODO add your handling code here: if(jCheckBox1.isSelected()==true) { jTextField1.setText("True"); } else { jTextField1.setText("False"); } }
for(int k=0;k<i;k++) { for(int l=0;l<Num(columnNameList);l++) { if((dataTp[k][l]=="bool") && (key[k][l]=="Default")) { //table.setDefaultRenderer(String.class,new def()); table.getColumnModel().getColumn(l).setCellRenderer(new chkBoxTableCellRenderer()); } } }
class chkBoxTableCellRenderer extends DefaultTableCellRenderer { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JCheckBox chk=new JCheckBox(); if(DefaultValue.strValue=="True") { chk.setSelected(true); return chk; } else { chk.setSelected(false); return chk; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)