I deal with numeric data that is often edited up or down by 0.01*Value_of_variable, so a spinner looks like a good choice compared to a usual text cell.
I've looked at DefaultCellEditor but it will only take text fields, combo boxes or check boxes.
Is there a convenient way to use a spinner?
... and overwrite the getCellEditorValue() method:
Simply extend
DefaultCellEditor
and overwrite thegetTableCellEditorComponent()
method to return aJSpinner
.Here's an example that addresses the issue I commented on camickr's answer. This is a complete and compilable example. Take what you need and ditch what you don't.
Jason's answer is perfect. To help others that might be looking for a Time and Date version, I've edited Jason's code to suit. Hope it helps someone as Jason's has helped me.
}