I'd like to obtain the following behaviour in a JTable:
So far I've overridden DefaultCellEditor. I can hook into getCellEditorValue and make the validation there, but I don't know how to prevent the cell from going back to the default renderer.
Thanks!
What about JTable's method editingStopped()? See also
/**
* Stops editing and
* returns true to indicate that editing has stopped.
* This method calls <code>fireEditingStopped</code>.
*
* @return true
*/
public boolean stopCellEditing() {
fireEditingStopped();
return true;
}
in the DefaultCellEditor
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With