Swing Event Java Tutorial

KeyStroke space = KeyStroke.getKeyStroke('Z');
   
   KeyStroke fromKeyEvent = KeyStroke.getKeyStrokeForEvent(keyEvent);