by: stag and fish; party animals. radio buttons are a way of letting users choose only one option...
TRANSCRIPT
![Page 1: By: Stag and Fish; Party Animals. Radio buttons are a way of letting users choose only one option of a list](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ec75503460f94bd2f63/html5/thumbnails/1.jpg)
RADIO BUTTONS AND CHECK BOXES
By: Stag and Fish; Party Animals
![Page 2: By: Stag and Fish; Party Animals. Radio buttons are a way of letting users choose only one option of a list](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ec75503460f94bd2f63/html5/thumbnails/2.jpg)
Radio Buttons
Radio buttons are a way of letting users choose only one option of a list
![Page 3: By: Stag and Fish; Party Animals. Radio buttons are a way of letting users choose only one option of a list](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ec75503460f94bd2f63/html5/thumbnails/3.jpg)
Uses of Radio Buttons
Uses: Surveys Multiple choice questions terms of service
![Page 4: By: Stag and Fish; Party Animals. Radio buttons are a way of letting users choose only one option of a list](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ec75503460f94bd2f63/html5/thumbnails/4.jpg)
How to create Radio Buttons
They are created by implementing `JRadioButton` and grouping the buttons into a `ButtonGroup`
public class Demo extends JPanel implements ActionListener { //Create a set of private reusable variables private String button1 = “Choice 1"; public Demo () { super(new BorderLayout()); //I have no idea what this does //Create Choice 1 JRadioButton button1 = new JRadioButton(Choice 1);
![Page 5: By: Stag and Fish; Party Animals. Radio buttons are a way of letting users choose only one option of a list](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ec75503460f94bd2f63/html5/thumbnails/5.jpg)
Check Boxes
Check boxes are a way to allow users to select multiple options from a list
![Page 6: By: Stag and Fish; Party Animals. Radio buttons are a way of letting users choose only one option of a list](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ec75503460f94bd2f63/html5/thumbnails/6.jpg)
Uses of Checkboxes
Uses: Surveys with many applicable choices Select all that apply Choosing items from a list
![Page 7: By: Stag and Fish; Party Animals. Radio buttons are a way of letting users choose only one option of a list](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ec75503460f94bd2f63/html5/thumbnails/7.jpg)
How to create Checkboxes
Check boxes are created using JCheckBox items with unique names
public class Checkboxes extends JPanelimplements ItemListener {
private JCheckBox b1; public Checkboxes() { super(new BorderLayout()); //This is a mystery //Create the check boxes. b1 = new JCheckBox("Do not uncheck!"); b1.setSelected(true);
![Page 8: By: Stag and Fish; Party Animals. Radio buttons are a way of letting users choose only one option of a list](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ec75503460f94bd2f63/html5/thumbnails/8.jpg)
Sources
Java Docs