How can I convert KeyEvent.VK_SPACE
(which is an integer) to an actual space?
String space = convertKeyEvent(KeyEvent.VK_SPACE);
System.out.println("Space=" + space + ".");
This should output
Space= .
And although this example uses Space, it should be a general converter for other characters as well, such as VK_0.
WHAT I HAVE TRIED
Note that this DOES NOT work:
String space = KeyEvent.getKeyText(KeyEvent.VK_SPACE);
System.out.println("Space=" + space + ".");
In Eclipse, this outputs:
Space=?.