I'd like to know if it is possible using TAB or Shift+TAB to navigate in different parts of the Borderpane element?
Asked
Active
Viewed 1,357 times
2
-
what do you mean by `parts of BorderPane` ? – ItachiUchiha Aug 12 '14 at 06:02
-
Sorry, I'd like to say the children of the BorderPane (Top, Left, Center, Right and Bottom). – jade Aug 12 '14 at 14:30
-
Well, you can switch between `Controls` present in the same `Layout`. If you have a `gridpane` in the center of `Borderpane`, which has 4 textfields and a button, you can use TAB to switch `Focus` between them – ItachiUchiha Aug 13 '14 at 15:48
1 Answers
0
You can try something like the following:
borderPane.getTop().addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {
@Override
public void handle(javafx.scene.input.KeyEvent event) {
if (event.getCode() == KeyCode.TAB) {
borderPane.getLeft().requestFocus();
}
}
});

damat-perdigannat
- 5,780
- 1
- 17
- 33
-
Thank you! After analysis, the BorderPane manages correctly the TAB and SHIFT+TAB. But, I had a problem when the previous control is a TabPane. Impossible to move focus to the previous focusable control outside the TabPane. I must implement a workaround to move back focus to the previous control. – jade Aug 20 '14 at 16:11
-
Move focus inside the TabPane has been handled correctly using the 8u20 version. – jade Sep 22 '14 at 16:18