Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable not processing initial keyPressed() event  RSS feed

 
G Estes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!