S
Simon Andrews
I have a swing application which contains several panels. I want one of
the panels to respond to the arrow keys and have registered accelerators
in a JMenu which do this correctly.
However, one of the other panels contains a JTree, and when this is
selected with the mouse it grabs the arrow key events first and they
don't make it back to the menu.
I've tried removing the binding in the tree by doing
tree.getInputMap().put(arrowKeyStroke,"none")
...for each arrow key. This stops the tree from responding to the key,
but it doesn't allow the event to pass back to the menu.
I've also tried using:
tree.unregisterKeyboardAction(arrowKeyStroke)
and
tree.getInputMap.remove(arrowKeyStroke)
...which didn't seem to have any effect at all.
How can I stop the JTree from capturing these events at all?
Cheers
Simon.
the panels to respond to the arrow keys and have registered accelerators
in a JMenu which do this correctly.
However, one of the other panels contains a JTree, and when this is
selected with the mouse it grabs the arrow key events first and they
don't make it back to the menu.
I've tried removing the binding in the tree by doing
tree.getInputMap().put(arrowKeyStroke,"none")
...for each arrow key. This stops the tree from responding to the key,
but it doesn't allow the event to pass back to the menu.
I've also tried using:
tree.unregisterKeyboardAction(arrowKeyStroke)
and
tree.getInputMap.remove(arrowKeyStroke)
...which didn't seem to have any effect at all.
How can I stop the JTree from capturing these events at all?
Cheers
Simon.