posted 21 years ago
I'm writing a new table component that extends from JTable. One of the behaviors to be implemented is to prevent the up and down arrow keys from navigating to an adjacent cell. Problem is, when a cell is selected (and being edited), something is handling the keyPressed(KeyEvent e) method before the table. I tried adding a KeyListener() to the component, but that doesn't help. It never gets there either. I suspect it's down inside the editor component - perhaps at the document level? The table does get the keyReleased(KeyEvent e) method okay.
The selected cell does change, but it does not start editing. Subsequent key events (including keyPressed) are captured at the JTable level and consumed appropriately.
What I need is to capture the initial keyPressed(KeyEvent e) and consume it...but where is it getting handled?
Any help? Thanks...