Shifting the focus from one cell to another in Jtable on tab press

前端 未结 2 1984
無奈伤痛
無奈伤痛 2021-01-22 08:36

Summary:

In my desktop application i load one Jtable and when in edit mode if i press tab i need the focus of the cell on to the next cell.

2条回答
  •  情深已故
    2021-01-22 09:35

    Normally tab works in jTable once getting the focus .If you want to edit next cell by pressing Tab key give the following code in the key release event of jTable.

     if (evt.getKeyCode() == 9) {
                jTable1.editCellAt(nextRowIndex, nextColumnIndex);
        }
    

提交回复
热议问题