This is the code:
String male = "Male";
String female = "Female";
JRadioButton checkGenderMale = new JRadioButton(male);
checkGenderMale.addActionListener(new genderListener());
JRadioButton checkGenderFemale = new JRadioButton(female);
checkGenderMale.addActionListener(new genderListener());
class genderListener implements ActionListener{
public void actionPerformed(ActionEvent event){
System.out.println( );
}
}
In the line System.out.println(); I would like the option (the Strings male or female which ever is selected) to print. So what might go in the parenthesis?
You need to write
In your action performed method.