Created
September 20, 2015 13:52
-
-
Save smamran/5391e7faade5c61d16a7 to your computer and use it in GitHub Desktop.
Exit FX Stage or Scene by Pressing Esc Key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
primaryStage.addEventHandler(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>(){ | |
@Override | |
public void handle(KeyEvent event) { | |
if(event.getCode() == KeyCode.ESCAPE){ | |
primaryStage.close(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment