This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JavaFX and the fly likes HBox, ChoiceBox and tab-order weirdness Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "HBox, ChoiceBox and tab-order weirdness" Watch "HBox, ChoiceBox and tab-order weirdness" New topic
Author

HBox, ChoiceBox and tab-order weirdness

iain coghill
Greenhorn

Joined: Apr 19, 2009
Posts: 11
Some unexpected tab-order oddities have cropped up when I use javafx.scene.control.ChoiceBox within an HBox.

Try the following:



What tab-order would you expect? I expected the first TextBox to have initial focus and on pressing <TAB> to cycle through the ChoiceBox then last two TextBox controls in order. What I get is rather different. The ChoiceBox gets initial focus and pressing <TAB> jumps back to first TextBox, then forward to the last two TextBoxs in order. Adding more ChoiceBox controls just adds to the weirdness, it seems ChoiceBox gets first preference in tab-order within the HBox, regardless of actual order. Replace HBox with VBox in the above code and things work in the manner you would expect

Anybody else experienced similar? Any way to manually assign tab-order or otherwise sidestep the issue?
 
 
subject: HBox, ChoiceBox and tab-order weirdness
 
Similar Threads
Turning off Tab traversal in a JTextArea
Pressing Tab enter JTable, pressing Tab again exit JTable
Making control have initial focus
Insider's Guide to Mixing Swing and JavaFX
enable disabled input using js