You've forgotten to set the value of the toggle button before returning it from the getTableCellEditorComponent
public Component getTableCellEditorComponent(JTable table,
Object value, boolean isSelected, int row, int column) {
buttonValue = (value == null) ? "" : value.toString();
toggle.setText(buttonValue);
return toggle;
}
To be honest, I'm curious with what's wrong with returning Boolean
from getColumnClass
in the table model for the Return
column and simply let the default renderer and editor deal with it...
Also...you're ignore the button value when you return it from the editor...
public Object getCellEditorValue() {
// System.out.println( buttonValue);
return buttonValue;
}
Frankly, probably better to use toggle.getText()
...