oops sorry for the double post :(
"George" <urdad@hotmail.com> wrote in news:1133720608.105362.322880
@g14g2000cwa.googlegroups.com:
> hi,
> i have an applet and i want to bind an action if a key is pressed
[quoted text clipped - 3 lines]
>
> george
Add a KeyListener to the applet, check which key was pressed, and act
appropriately.
addKeyListener(new KeyAdapter()
{
public void keyPressed(KeyEvent e)
{
// ...
}
});
If the same action can be invoked through a menu or button click, you
should look into Actions.
class KeyAction extends AbstractAction
{
public KeyAction(int mnemonic)
{
putValue(MNEMONIC_KEY, new Integer(mnemonic));
}
public void actionPerformed(ActionEvent e)
{
// ...
}
}

Signature
Beware the False Authority Syndrome