Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

shortcut key action (ctrl+arrow) in button  RSS feed

pratap chandran
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one screen that contains JTable, JCheckbox and JButton. I need to perform shortcut key action on one JButton to perform the action to move the content from one JTable to another JTable. The shortcut key to perform this operation on this JButton is ctrl+right arrow. I am using registerKeyBoardAction(). My code is:


When the focus is in the main window this code is working. But when the focus is in the JTable this code not working.

Similarly "PAGE_UP" & "PAGE_DOWN" key also not working without the modifier keys irrespective of the focus. The code for this is :

KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0),

Can anyone help me to perform these action?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!