Hi,
Another way of doing it is registering the tab key to an action for the table.
Maybe this snippet may help.
Action focusNextRow = new AbstractAction()
{
public void actionPerformed(ActionEvent e)
{
int nextRow = servicesTable.getSelectedRow()+ 1;
if (servicesTable.getSelectedRow() != (servicesTable.getRowCount() - 1))
{
servicesTable.changeSelection(
nextRow,
2,
false,
false);
servicesTable.editCellAt(nextRow, 2);
// Defect : 5859
// Exception Ctrl/Enter used on Ser. to be Est Tab
// User can using ctrl/Enter on the on on-editable cells in
// the table.
// servicesTable.getEditorComponent().requestFocus();
TableCellEditor tableCellEditor = servicesTable.getCellEditor(nextRow,2);
Component component = tableCellEditor.
getTableCellEditorComponent(servicesTable, servicesTable.getValueAt(nextRow,2),
true, nextRow, 2);
}
}
};
servicesTable.getInputMap(1).put( KeyStroke.getKeyStroke
(KeyEvent.VK_ENTER, InputEvent.CTRL_MASK), "focusNextRow");
servicesTable.getActionMap().put("focusNextRow", focusNextRow);