JavaFX: How to change the focus traversal policy?

后端 未结 10 1905
广开言路
广开言路 2020-11-30 04:34

Is it possible in JavaFX to change the focus traversal policy, like in AWT?

Because the traversal order for two of my HBoxes is wrong.

10条回答
  •  误落风尘
    2020-11-30 05:12

    You can use NodeName.requestFocus() as said above; furthermore, make sure you request this focus after instantiating and adding all of your nodes for the root layout, because as you do so, the focus will be changing.

提交回复
热议问题