21

How can I set tab order (focus order) for elements, for example text field in SceneBuilder?

  • 1
    This is potentially a duplicate (or closely related to): [JavaFX: How to change the focus traversal policy?](http://stackoverflow.com/questions/15238928/javafx-how-to-change-the-focus-traversal-policy) – jewelsea Jun 05 '15 at 23:02

4 Answers4

32

The answer: In SB on the Hierarchy panel it's necessary to set such order of nodes which you need for tab order.

9

I found a workaround, open the fxml file with a text editor or an xml editor and bring the input controls into the requested order. This helped in my case.

Thorsten
  • 315
  • 2
  • 7
6

You can do this easily with SceneBuilder. Open fxml file with scenebuilder and got to hierarchy under Document tab. Place input controls into a order you want by dragging input controls. Then focus traversal policy will work nicely when you press tab.

scenebuilder hierarchy

Jamith NImantha
  • 1,999
  • 2
  • 20
  • 27
  • please don't post the exact same answer multiple times. If the questions are duplicates, mark them as such and vote to close. If not, tailor the answer the question, highlighting the differences in both questions and your answer. – kleopatra Apr 09 '19 at 08:31
0

You can set tab order according to the components location in the parent panel in scene builder.

Danra
  • 9,546
  • 5
  • 59
  • 117