LogoLogo
v7.0.0
v7.0.0
  • TotalCross Overview
  • TotalCross Javadoc
  • TotalCross Changelog
  • Roadmap
  • Documentation
    • Getting Started
      • First embedded project with TotalCross
    • 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
      • API Overview
      • API Rest
      • Asynchronous Task
      • Camera
      • Control
        • Main Window
        • Window
        • Container
      • GPS
      • HTTPS and SSL
      • JSON
      • Maps
        • Maps - Deprecated
        • Static Map
      • Material Design Standards
      • Ninepath
      • Notifications
      • PrinterManager
      • Push Notification Firebase
      • Scanner
      • SOAP
      • Socket
      • SocketServer
      • SQLite Encryption
      • QR Code Generator
      • totalcross.sys
      • Youtube API
    • Creating an Issue
    • Contributing
      • Branch workflow
      • Writing documentation
    • Guides
      • App Architecture
        • Suggested Architecture
        • Why do Design Patterns help with the application's organization?
          • MVC Architecture Pattern
          • Template Pattern
          • Data Persistence: DAO Pattern.
        • Separation of concepts: What is the best way to create UI interfaces?
        • Positioning
          • Manual Positioning
        • Relative Positioning
        • Best practices to improve project maintenance
      • Device Simulator
      • Package your app from scratch
        • TotalCross SDK
        • Environment Variables in IDE
          • Eclipse
          • IntelliJ
        • Deploy your app with a dependecy TC
        • Deploy iOS
          • Using Development certificate to test your apps
      • Understanding TotalCross for Linux ARM
      • Running C++ applications with TotalCross
      • Web Services
    • Miscelaneous
      • Java JDK 8
      • Maven
      • Installing Visual Studio Code
    • FAQ
      • IMEI in Android 10
Powered by GitBook
On this page
  • Overview
  • Source Code
  • Attributes
  • Methods
  • References

Was this helpful?

  1. Documentation
  2. Components

Radio Group

PreviousRadioNextScroll Container

Last updated 6 years ago

Was this helpful?

Overview

A radio group is a group of (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
  // Creating a RadioGroup
RadioGroupController radioGroup = new RadioGroupController();
  // Assigning RadioButtons to the RadioGroup
Radio radio = new Radio("RadioButton", radioGroup);
add(radio, LEFT+100, AFTER+100 ,PREFERRED+100,PREFERRED+25);

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

To see the complete example .

See the for more information

click here
JavaDocs
Radios