嗨,我有2个名单 定义:
ArrayList<JLabel> questionsList = new ArrayList<JLabel>();
ArrayList<JRadioButton> answersList = new ArrayList<JRadioButton>();
我试着读出这样的问答:
1st Question
answer1
answer2
2nd Question
answer1
answer2
etc.
因此,第一个问题是从列表中读取,“强度”问题列表 < /强度 > 然后我想从另一个列表中读取,“强度”答案列表 强度”所有答案,等等。
In questionsList I read data from mysql and they are saved in JLabels in format like:
1. Question one
2. Question two
etc
In answersList I read data from mysql and they are saved in JRadioButtons in format like:
answer1
answer2
etc
到目前为止,我的代码是:
int height = 0;
for(int i1 =0; i1<questionsList.size(); i1++)
{
client.insideFillPollPanel.add(questionsList.get(i1)).setBounds(20, 20+150*i1, 480, 14);
height = 20+150*i1;
for(int i2 =0; i2<answersList.size(); i2++)
client.insideFillPollPanel.add(answersList.get(i2)).setBounds(20, 50+30*i2, 480, 14);
}
我该如何解答它, 才能像第一个格式一样显示, 我展示了这样的问题, 然后是Asnwers问题和Asnwers?