Call a function that requires a KeyEvent parameter
问题 I would like to call this java function in another function. How can I manualy fire a KeyEvent? private void chooseItemByKey(KeyEvent event) I tried chooseItemByKey(new KeyEvent(null, null, null, null, null, KeyCode.DOWN, false, false, false, false)); to fire a KeyCode "Down" but my JRE told me there's a Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: argument type mismatch The method needs the KeyEvent because I trigger it also by a key, but I need to