Using JavaFX 2.2 Mnemonic (and accelerators)
For your use case, I think you actually want to use an accelerator rather than a mnemonic. button.getScene().getAccelerators().put( new KeyCodeCombination(KeyCode.S, KeyCombination.SHORTCUT_DOWN), new Runnable() { @Override public void run() { button.fire(); } } ); In most cases it is recommended that you use KeyCombination.SHORTCUT_DOWN as the modifier specifier, as in the code above. A good explanation … Read more