Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't get arrow keys for JTable if on a JTabPane  RSS feed

 
Sarone Thach
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I have this weird problem where I cannot get the key events for the JTable as it is contained inside the JTabPane.
When i press the arrow keys it changes the to a neigbouring tab.
How do I get arrow key presses for the JTable? (I have already registered to listen to keyPressed and keyReleased events for the JTable.)
any suggestions are appreciated.
thanks,
Sarone
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This code prevents the KeyEvent corresponding to the down arrow from being dispatched to the table.

[ December 20, 2003: Message edited by: Jose Botella ]
 
Sarone Thach
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Jose,
thanks alot for your code. I swaped the boolean value around and it works great!!


Sarone
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!