JRadioButton: getModel() : JRadioButton « javax.swing « Java by API






JRadioButton: getModel()

  
import javax.swing.ButtonGroup;
import javax.swing.ButtonModel;
import javax.swing.JRadioButton;

public class Main {
  public static void main(String[] argv) throws Exception {

    JRadioButton radioButton = new JRadioButton();
    ButtonGroup group = new ButtonGroup();
    ButtonModel model = radioButton.getModel();
    group.setSelected(model, true);

  }
}

   
    
  








Related examples in the same category

1.new JRadioButton(String text, boolean selected)
2.JRadioButton: setActionCommand(String actionCommand)
3.JRadioButton: setMnemonic(int mnemonic)
4.JRadioButton: setSelected(boolean b)