This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
public void setQandA();
label1.setText("question number:" + " "+ (i+1));
radioButton1.setText(answer1[i]); // when i comment those lines program running
radioButton1.setText(answer2[i]); // otherwise not
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button. Thanks, and welcome to JavaRanch!