Search…
v7.0.0
TotalCross Overview
TotalCross Javadoc
TotalCross Changelog
Roadmap
Documentation
Getting Started
Components
Accordion
Aligned Labels
Button
Check
ComboBox
Dynamic Scroll
Edit
Floating Button
Gpiod
Grid
GridContainer
Image
ImageControl
ImageList
Label
Material Icons
Material Window
MessageBox
Multi Edit
Progress Bar
Progress Box
Radio
Radio Group
Scroll Container
Side Menu
Slider
Sliding Window
Spin List
Spinner
Switch
Tabbed Container
Velocimeter
APIs
Creating an Issue
Contributing
Guides
Miscelaneous
FAQ
Powered By
GitBook
Radio Group
Overview
A radio group is a group of
Radios
(
RadioButton
). It allows a user to select at most one radio from a set. Checking one RadioButton that belongs to a radio group unchecks any previous checked radio button within the same group.
Source Code
RadioGroupControllerSample.java
1
// Creating a RadioGroup
2
RadioGroupController
radioGroup
=
new
RadioGroupController
();
3
// Assigning RadioButtons to the RadioGroup
4
Radio
radio
=
new
Radio
(
"RadioButton"
,
radioGroup
);
5
add
(
radio
,
LEFT
+
100
,
AFTER
+
100
,
PREFERRED
+
100
,
PREFERRED
+
25
);
Copied!
To see the complete example
click here
.
Attributes
Type
Name
Description
boolean
sendPressOnLast
Set to false to disable sending PRESSED events to the previous control
Methods
Type
Name
Description
Constructor
RadioGroupController( )
Instance a empty RadioGroupController
int
add(Radio newMember )
Adds a new Radio to the list of Radios this controller handles
Radio
getRadio(int idx)
Returns the Radio at the given index
int
getSelectedIndex( )
Returns the currently selected index (in the order that the Radios were added to the container), or -1 if none
Radio
getSelectedItem( )
Returns the currently selected Radio, or null if none
int
getSize( )
Returns the number of Radio's
void
remove(Radio oldMember)
Removes the given Radio from the list of Radios this controller handles
void
setSelectedIndex(int i)
Selects the given radio and deselects the other one
void
setSelectedItem(String text)
Selects a radio whose text matches the given caption
void
setSelectedItem(String text, boolean caseInsensitive)
Selects a radio whose text starts with the given caption
References
See the
JavaDocs
for more information
Previous
Radio
Next
Scroll Container
Last modified
3yr ago
Copy link
Contents
Overview
Source Code
Attributes
Methods
References