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 looke
... and overwrite the getCellEditorValue() method:
class SpinnerEditor extends DefaultCellEditor
{
private JSpinner spinner;
public SpinnerEditor()
{
super( new JTextField() );
spinner = new JSpinner(new SpinnerNumberModel(0, 0, 100, 5));
spinner.setBorder( null );
}
public Component getTableCellEditorComponent(
JTable table, Object value, boolean isSelected, int row, int column)
{
spinner.setValue( value );
return spinner;
}
public Object getCellEditorValue()
{
return spinner.getValue();
}
}