The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > javax.swing  [141 examples] > JRadioButton  [6 examples]

e769. Selecting a JRadioButton Component in a Button Group

    // To create a radio button and button group,
    // see e768 Creating a JRadioButton Component
    
    // Select the radio button; the currently selected radio button is deselected.
    // This operation does not cause any action events to be fired.
    ButtonModel model = radioButton.getModel();
    group.setSelected(model, true);

 Related Examples
e768. Creating a JRadioButton Component
e770. Determining the Selected JRadioButton in a Button Group
e771. Determining If a JRadioButton Component Is Selected
e772. Adding an Icon to the Label of a JRadioButton Component
e773. Customizing the Icons in a JRadioButton Component

See also: Actions    JButton    JCheckBox    JComboBox    JDesktop and JInternalFrame    JFrame, JWindow, JDialog    JLabel    JList    JProgressBar    JScrollPane    JSlider    JSpinner    JSplitPane    JTabbedPane    JToolBar    Keystrokes and Input Maps    Layout    Look and Feel    Menus    Progress Monitor    The Screen    Tool Tips    UI Default Values   


© 2002 Addison-Wesley.