Skip to content

RadioGroup

Controller managing mutual exclusivity and selection state across multiple RadioButton instances.

Overview

RadioGroup is a logical manager that coordinates a collection of RadioButton widgets. It ensures only one button is selected at any time and allows querying the selected button or value directly.

RadioGroup Controller

RadioGroup group = new RadioGroup()
        .add(optionA)
        .add(optionB);
String selected = group.selectedValue();

API

RadioGroup::add(RadioButton)

Add RadioButton

Adds a RadioButton to the managed exclusive group.

Parameter Type Description
button RadioButton —

Returns RadioGroup: this widget for fluent configuration.

RadioGroup::selectedValue()

Get Selected Value

Returns the value string of currently selected RadioButton, or null.

Returns String.