How do I make hitting the Tab Key in TextArea navigates to the next control ?
I could add a listener to cath de key pressed event, but how do I make te TextArea control
This code traverse focus if pressing TAB and insert tab if pressing CONTROL+TAB
textArea.addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler() {
@Override
public void handle(KeyEvent event) {
if (event.getCode() == KeyCode.TAB) {
SkinBase skin = (SkinBase) textArea.getSkin();
if (skin.getBehavior() instanceof TextAreaBehavior) {
TextAreaBehavior behavior = (TextAreaBehavior) skin.getBehavior();
if (event.isControlDown()) {
behavior.callAction("InsertTab");
} else {
behavior.callAction("TraverseNext");
}
event.consume();
}
}
}
});