Пример #1
0
 // Display question and answer choices
 public void readQuestionAnswer(int questionID) {
   lblmess.setText("  " + quizPossibleAnswers[questionID][0]);
   choice1.setText(quizPossibleAnswers[questionID][1]);
   choice2.setText(quizPossibleAnswers[questionID][2]);
   choice3.setText(quizPossibleAnswers[questionID][3]);
   choice4.setText(quizPossibleAnswers[questionID][4]);
   choice1.setSelected(true);
 }
Пример #2
0
  private static JRadioButton[] buildLangButtons() {
    java.util.List<JRadioButton> btns = new java.util.ArrayList<JRadioButton>();

    for (Language lng : LANGS) {
      JRadioButton btn = new JRadioButton(lng.toString());
      btn.setText(lng.toString());
      btns.add(btn);
    }

    final ButtonGroup group = new ButtonGroup();
    for (final JRadioButton jrb : btns) {
      group.add(jrb);
    }

    JRadioButton[] res = new JRadioButton[btns.size()];
    return btns.toArray(res);
  }