JTables

Using combo-box cell editor

If you use a combo-box cell editor, you must call:

table.setSurrendersFocusOnKeystroke (true);

in order to use the keyboard to choose a value in the combo-box.

Checking input

Checking user input to table cells has to deal with the following behaviour of JTables:
table.putClientProperty ("terminateEditOnFocusLost", Boolean.TRUE);

If the user now attempts to move to a component outside the table, the JTable calls editor.stopCellEditing. If stopCellEditing returns true, model.setValueAt is called and editing is stopped. If stopCellEditing returns false, editor.cancelCellEditing is called and editing is stopped. In both cases, the move succeeds and focus is transferred outside the table. This behaviour appears not to depend on whether it was the JTable or the editor that initially had focus.
table.setSurrendersFocusOnKeystroke (true);

If the user now attempts to move outside the table, it will always be the editor that loses focus.

Given the above behaviour, the following steps seem to be the simplest way to do input verification: