Вот такая простота:
class SimpleCellEditor extends DefaultCellEditor {
static JTextField textField = new JTextField();
SimpleCellEditor() {
super(textField);
textField.setBorder(BorderFactory.createLineBorder(Color.RED, 1));
}
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int rowIndex, int vColIndex) {
textField.setText(value.toString());
return textField;
}
public Object getCellEditorValue() {
return textField.getText();
}
public void cancelCellEditing() {
super.cancelCellEditing();
System.out.println("cancelled");
}
}
Все работает, а вот последняя функция — ни в какую, он в нее даже не заходит. Гугль ковырял, документацию ковырял — ничего не нашел.
Подскажите, в чем могут быть проблемы?