ButtonGroup Class , like this
JRadioButton birdButton = new JRadioButton("bird");
JRadioButton catButton = new JRadioButton("cat");
ButtonGroup group = new ButtonGroup();
group.add(birdButton);
group.add(catButton);
birdButton.setSelected(true);
at the same time just one of the catButton or birdButton can be selected