Ok, i know sond as a basic question, but how do i use the arrow key? I been able to use the arrow key on the numric keypad...but its not the best.
Here gow i do it
private void keyPressMove(Object source, KeyPressEvent e)
char key = (char)e.getKeyChar();
MoveKey.setText("" + key);
String keyP = MoveKey.getText();
It as worked, but it is anoying to use it this way...also when i use the normal arrow key it make it imposible to use any hother key!
Please post the source code! (if you can)
PS-Im not sure this is important but I use VJ++ 6
I personally like to use the KeyEvent constants such as KeyEvent.VK_UP in a switch statement. I think it is VK_UP but what ever it is it saves you the effort of converting the char to a string and comparing the results. You can also use the ascii numbers for alpha characters and cast them to ints for switches. Here is a sample -