I am trying to implement two radiobuttons and make them mutually exclusive.
public ProvincesPanel() {
//radiobuttons definitions.csv
this.setName("Provinces 2");
ButtonGroup vanillaOrMod = new ButtonGroup();
vanillaOrMod.add(rdbDefNew);
vanillaOrMod.add(rdbDefVan);
rdbDefNew= new JRadioButton("new definition.csv file");
rdbDefVan= new JRadioButton("vanilla definition.csv file");
add(rdbDefNew);
add(rdbDefVan);
}
Now for some reason that I don't understand ,the buttons are still not exclusive?
Thank you for your time