Hi,
The code below compiles without any errors, but the JRadioButton's dont seem to respond when any are selected.
In the actionsPerformed() method, if JButton 'next' is clicked:
-then proceed to assign data from JTextFields
-if either one of the JRadioButton's are selected, then..
-assign data to variables
-end of method.
The JButton 'next' works correctly, but the JRadioButton's 'easy', 'mild' and 'hard' don't respond (no data are assigned to the variables 'questions' and 'level').
Thanks in advanced.
public void actionPerformed(ActionEvent e) { //if JButton 'next' is clicked.. if(e.getSource() == next) { //Get details from textfield.. name = String.valueOf(nameField.getText()); topic = String.valueOf(topicField.getText()); //also if JRadioButton 'easy' is selected.. if(e.getSource() == easy) { questions = layQuestions.getEasyQuestionList(); level = "Easy"; } //or if JRadioButton 'mild' is selected.. else if(e.getSource() == mild) { questions = layQuestions.getEasyQuestionList(); level = "Mild"; } //or if JRadioButton 'hard' is selected.. else if(e.getSource() == hard) { questions = layQuestions.getHardQuestionList(); level = "Hard"; } } }