Prevent default behavior of events
cshNov 16 2011 — edited Nov 17 2011How can I prevent the default behavior of events?
I know this concept from JavaScript or ActionScript where you could prevent the default behavior of an event by calling e.preventDefault().
How can I achieve this in JavaFX?
E.g. I have a KeyEvent on a TextArea and want to catch the Enter key and prevent it from positioning the cursor in the new line.
I tried consume(), but it seems, it is the equivalent to e.stopPropagation().