Hi
i have a class which is being used to add a question followed by several choices like a multiple choice question. the choices are listed using JRadioButton.
Code:
public Choices(String labelText, int noOfRB, String[] radioButtonText) {
label = new JLabel(labelText);
group = new ButtonGroup();
panel = new JPanel();
panel.setLayout(new FlowLayout());
panel.add(label);
radioButtons = new JRadioButton[noOfRB];
for (int i=0; i<noOfRB; i++) {
radioButtons[i] = new JRadioButton(radioButtonText[i]);
panel.add(radioButtons[i]);
group.add(radioButtons[i]);radioButtons[i].addActionListener(this);
}
}
tha addActionListner piece of code gives me the following error
" the method addActionListener(ActionListener) in the type AbstractButton is not applicable for the arguments (Choices)
could any one please help my finding my mistake
thanks