Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Stop "Ctrl-Page Down" in a JList but propergate the event

boomahJul 18 2011 — edited Jul 19 2011
Hi all. I have a JList inside a tabbed pane.

On my tabbed pane I have hot keys such that Ctrl-Page Up and Ctrl-Page Down change the tab. This works fine except when a JList has focus in the tab.

When I press Ctrl-Page Up or Page Down on the JList I don't want it do anything and I would like the tab to change as expected.

If I add this to my JList:
list.getInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, InputEvent.CTRL_DOWN_MASK), "none")
it stops my JList from reacting to the Ctrl-Page Down but it doesn't propergate it up to the tabbed pane.

Does anyone know how I can do this?

Thanks, Nick.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 16 2011
Added on Jul 18 2011
6 comments
350 views