Hi I am handling key Pressed events like this.


JButton samex;

public void myMethod()
{
   samex = new JButton("Same");
   samex.setMnemonic(KeyEvent.VK_V);
   samex.setActionCommand("Same");
   addKeyListener(this);             //my class Extends KeyListener
}

public void keyTyped(KeyEvent e){}
public void keyReleased(KeyEvent e){}
public void keyPressed(KeyEvent e)
{
   switch(e.getKeyCode())
   {
        case KeyEvent.VK_V:
        {
           doWhatever();
        }
   }
}

this works find, but what I would like to do, is user the space bar
instead of the "v" key, however if I switch VK_V to VK_SPACE the space bar
doesn't seem to generated a keyPressed event.

Has anyone experienced this problem. Does anyone have a suggestion for how
I can get a key event when the key hit is the space bar.

Thanks for any suggestions.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to