Daily Archives: 2007-03-18


5
When you press the Enter key while in a JTable, you’ll notice how the row selection changes to the next row or to the first row if the former row selected was the last row in the model. You can change this playing with the traversal key policy, but this is quite complicated. The easy way is to consume the event if the enter key has been pressed. You can accomplish this doing the following: [crayon-5b77c776cfbd5535807542/] It’s very important to consume the event during the keyPressed event and not during the other possible keyEvents not doing so will mean that […]

Remove JTable’s Enter Key behavior