SlideShare a Scribd company logo
1 of 2
In Java can anyone explain grouping for radio buttons or check boxes and how to add
components to a group?
Solution
We are creating a radiobutton as shown as below
JRadioButton male1 = new JRadioButton("Male");
JRadioButton fmale1 = new JRadioButton("FeMale");
Male and FeMale are the name of the radiobutton
we can group a radiobutton together by using this header file "javax.swing.ButtonGroup " as
shown below
ButtonGroup group = new ButtonGroup();
group.add(male1);
group.add(fmale1);
follow these steps while using a ButtonGroup component.
Subclass JFrame
Call ContextPane together with a layout manager
Declare and configure a set of radio buttons
Instantiate a ButtonGroup object
Call the add method on that buttongroup object in order to add each button to the group
In Java can anyone explain grouping for radio buttons or check boxes a.docx

More Related Content

More from rtodd101

In a survey of a TriDelt chapter with 50 members- 24 were taking math.docx
In a survey of a TriDelt chapter with 50 members- 24  were taking math.docxIn a survey of a TriDelt chapter with 50 members- 24  were taking math.docx
In a survey of a TriDelt chapter with 50 members- 24 were taking math.docxrtodd101
 
In a preparation for a synthetic plant hormone I experiment- 1- Give a.docx
In a preparation for a synthetic plant hormone I experiment- 1- Give a.docxIn a preparation for a synthetic plant hormone I experiment- 1- Give a.docx
In a preparation for a synthetic plant hormone I experiment- 1- Give a.docxrtodd101
 
In 2012 Tony invests $35-000 in an activity for which he is not a mate.docx
In 2012 Tony invests $35-000 in an activity for which he is not a mate.docxIn 2012 Tony invests $35-000 in an activity for which he is not a mate.docx
In 2012 Tony invests $35-000 in an activity for which he is not a mate.docxrtodd101
 
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (2).docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (2).docxIn 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (2).docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (2).docxrtodd101
 
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000.docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000.docxIn 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000.docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000.docxrtodd101
 
In 1993 the 101st International Olympic Committee met in Monaco to sel.docx
In 1993 the 101st International Olympic Committee met in Monaco to sel.docxIn 1993 the 101st International Olympic Committee met in Monaco to sel.docx
In 1993 the 101st International Olympic Committee met in Monaco to sel.docxrtodd101
 
Implement a Linked List as a subclass of the abstract List class- Make.docx
Implement a Linked List as a subclass of the abstract List class- Make.docxImplement a Linked List as a subclass of the abstract List class- Make.docx
Implement a Linked List as a subclass of the abstract List class- Make.docxrtodd101
 
imagine a simple economy of freedonia that uses gold as its currency ( (1).docx
imagine a simple economy of freedonia that uses gold as its currency ( (1).docximagine a simple economy of freedonia that uses gold as its currency ( (1).docx
imagine a simple economy of freedonia that uses gold as its currency ( (1).docxrtodd101
 
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (1).docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (1).docxIn 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (1).docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (1).docxrtodd101
 

More from rtodd101 (9)

In a survey of a TriDelt chapter with 50 members- 24 were taking math.docx
In a survey of a TriDelt chapter with 50 members- 24  were taking math.docxIn a survey of a TriDelt chapter with 50 members- 24  were taking math.docx
In a survey of a TriDelt chapter with 50 members- 24 were taking math.docx
 
In a preparation for a synthetic plant hormone I experiment- 1- Give a.docx
In a preparation for a synthetic plant hormone I experiment- 1- Give a.docxIn a preparation for a synthetic plant hormone I experiment- 1- Give a.docx
In a preparation for a synthetic plant hormone I experiment- 1- Give a.docx
 
In 2012 Tony invests $35-000 in an activity for which he is not a mate.docx
In 2012 Tony invests $35-000 in an activity for which he is not a mate.docxIn 2012 Tony invests $35-000 in an activity for which he is not a mate.docx
In 2012 Tony invests $35-000 in an activity for which he is not a mate.docx
 
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (2).docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (2).docxIn 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (2).docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (2).docx
 
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000.docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000.docxIn 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000.docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000.docx
 
In 1993 the 101st International Olympic Committee met in Monaco to sel.docx
In 1993 the 101st International Olympic Committee met in Monaco to sel.docxIn 1993 the 101st International Olympic Committee met in Monaco to sel.docx
In 1993 the 101st International Olympic Committee met in Monaco to sel.docx
 
Implement a Linked List as a subclass of the abstract List class- Make.docx
Implement a Linked List as a subclass of the abstract List class- Make.docxImplement a Linked List as a subclass of the abstract List class- Make.docx
Implement a Linked List as a subclass of the abstract List class- Make.docx
 
imagine a simple economy of freedonia that uses gold as its currency ( (1).docx
imagine a simple economy of freedonia that uses gold as its currency ( (1).docximagine a simple economy of freedonia that uses gold as its currency ( (1).docx
imagine a simple economy of freedonia that uses gold as its currency ( (1).docx
 
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (1).docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (1).docxIn 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (1).docx
In 1985 Ted Thomas took $6-000 of his savings- borrowed another $4-000 (1).docx
 

Recently uploaded

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 

Recently uploaded (20)

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 

In Java can anyone explain grouping for radio buttons or check boxes a.docx

  • 1. In Java can anyone explain grouping for radio buttons or check boxes and how to add components to a group? Solution We are creating a radiobutton as shown as below JRadioButton male1 = new JRadioButton("Male"); JRadioButton fmale1 = new JRadioButton("FeMale"); Male and FeMale are the name of the radiobutton we can group a radiobutton together by using this header file "javax.swing.ButtonGroup " as shown below ButtonGroup group = new ButtonGroup(); group.add(male1); group.add(fmale1); follow these steps while using a ButtonGroup component. Subclass JFrame Call ContextPane together with a layout manager Declare and configure a set of radio buttons Instantiate a ButtonGroup object Call the add method on that buttongroup object in order to add each button to the group