public class KeystrokeForwarder extends Object implements KeyListener
KeystrokeForwarder
as
KeyListener
on a source component. Then use the
registerKeystroke
and
addTarget
methods
to register keystrokes which are forwarded when the source component receives them.
Forwarded keystroke events are always consumed and will not reach the source component.Constructor and Description |
---|
KeystrokeForwarder() |
Modifier and Type | Method and Description |
---|---|
void |
addTarget(JComponent target)
Register all keystrokes defined in the component input map for forwarding to the
given component.
|
protected void |
forwardKeyEvent(KeyEvent event)
Forward a key event, if a target component is registered to the keystroke corresponding
to the event.
|
void |
keyPressed(KeyEvent event) |
void |
keyReleased(KeyEvent event) |
void |
keyTyped(KeyEvent event) |
void |
registerKeystroke(AWTKeyStroke keystroke,
Component target)
Register a keystroke to be forwarded to the target component.
|
public void addTarget(JComponent target)
public void registerKeystroke(AWTKeyStroke keystroke, Component target)
public void keyPressed(KeyEvent event)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent event)
keyReleased
in interface KeyListener
public void keyTyped(KeyEvent event)
keyTyped
in interface KeyListener
protected void forwardKeyEvent(KeyEvent event)
Copyright © 2001-2013 the JGloss developers. All Rights Reserved.