• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable not processing initial keyPressed() event

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic