How to write a TableModelListener[
^]
You might want to read that. There are multiple Listener-Implementations, choose the one that seems to be the right one for you. I can recommend the TableModelListener - but also the
FocusListener[
^] (
focusLost(FocusEvent e)
) might suite your needs.
No matter which one you might choose, you need to validate the entered String. You can parse the entered String and react on the NumberFormatException and set up a switch-condition to limit the range.