srecord noeq ScreenSelectorRadioButtons(SimpleLiveValue lvScreenNr) is Swingable { transient ButtonGroup radioButtons; settable bool compactLayout; settable S screenLabel = "Screen"; visualize { radioButtons = jRadioButtons( countIteratorAsList(screenCount(), i -> (compactLayout ? "": screenLabel + " ") + (i+1))); selectRadioButton(radioButtons, lvScreenNr!); onRadioButtonChange(radioButtons, i -> lvScreenNr.set(i)); ret compactLayout ? hstack(flattenList2(nempty(screenLabel) ? jlabel(screenLabel) : null, buttonsInGroup(radioButtons))) : jline(flattenList2(buttonsInGroup(radioButtons))); } }