javafx Requesting focus for Radio Buttons


Example

Let's say the second RadioButton out of three is pre-selected with setSelected(Boolean), the focus is still at the first RadioButton by default. To change this use the requestFocus() method.

radioButton2.setSelected(true);
radioButton2.requestFocus();