static void emulateKeyPress(int javaKeyEventCode) {
    EventQueue systemEventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue();
    systemEventQueue.postEvent(
      new KeyEvent(new JPanel(), KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, javaKeyEventCode, KeyEvent.CHAR_UNDEFINED)
    );
    systemEventQueue.postEvent(
      new KeyEvent(new JPanel(), KeyEvent.KEY_RELEASED, System.currentTimeMillis(), 0, javaKeyEventCode, KeyEvent.CHAR_UNDEFINED)
    );
  }
static void emulateKeyPress(int javaKeyEventCode)