JRadioButton question for getting the state

Alright so i have a group of JradioButtons in a group callled buttonGroup

and im tring to get the state of 1 of the buttons like if it is selected or not…
my JRadioButton names are b1, b2, and so on…
i have the folowing code


		if(e.getSource() == fightBoss)
		{
			if(b1.getState() == true)
			{
				bossLvl = 1;
			}
			else if(b2.getState() == true)
			{
				bossLvl = 2;
			}

But eclipse is telling me i cannot use getState i have also tried getSelectedItem and so forth…but they dont seem to work any ideas on what i should do?

Try using .isSelected() instead