Programmatically unfocus a TextField?
990159Feb 14 2013 — edited Feb 14 2013On my view I only have one editable content: Text in a TextField. The problem is that as a user one never gets rid of the focus (because there is nothing else to focus on), once the TextField is focused. I want to remove the focus from the TextField when the user presses Enter. I know how to react to the Enter key being pressed, but I don't know how to unfocus a control/TextField programmatically?
I got the hint to use http://docs.oracle.com/javafx/2/api/javafx/scene/Node.html#setFocused(boolean), but this method is protected and not public, so I can't call this method from the controller assigned to the view containing the TextField. Is this intended? Is there any other way for unfocusing a control in JavaFX 2?
Thanks for any hint!
Edited by: srynoname on 14.02.2013 12:47