Если учесть, что у меня есть компонент ButtonGroup
, у которого есть два JRadioButton
, например:
JRadioButton bButton = new JRadioButton("Boy");
JRadioButton gButton = new JRadioButton("Girl");
ButtonGroup group = new ButtonGroup();
bButton.setSelected(true);
group.add(bButton);
group.add(gButton);
Как я могу получить все компоненты JRadioButton
из ButtonGroup
, упорядоченные по умолчанию, чтобы я мог установить первый JRadioButton
Selected?