im new to java swing and im building an application which creates a resume based on user inputs and then displays the resumes created.
i have a label which ask the user whether theyre part of a STEM course or not. so i have two radio buttons which accomplish that task with names : 1.STEM 2.Non STEM
ive added them to a buttongroup so only one is selected.
public void groupButton(){
bg1 = new ButtonGroup();
bg1.add(stemRadioButton);
bg1.add(nonStemRadioButton);
}
Each time i try to get the value of the radio button selected it keeps returning a null value.
Im new to this and i think it might have been answered and any help would be of great help ! thanks in advance !
EDIT :: i try retrieving the value by bg1.getSelected().getActionCommand; ive also tried using the getText method too.