我无法从测验表中获取测验并按下下一个按钮逐一显示在textarea中..请帮我找出解决方案
public class QuizesController implements Initializable {
int id=1;
@FXML
private Label l1;
@FXML
private Label l2;
@FXML
private Label l3;
@FXML
private Label l4;
@FXML
private TextArea txtQuiz;
@FXML
private RadioButton c1;
@FXML
private RadioButton c2;
@FXML
private RadioButton c3;
@FXML
private Button btnNext;
@FXML
private Button btnStart;
/**
*
* @param event
* @throws IOException
*/
@FXML
public void setBtnNextclicked(javafx.event.ActionEvent event) throws IOException{
SessionFactory sessionfactory=new Configuration().configure().buildSessionFactory();
Session sessin=sessionfactory.openSession();
sessin.beginTransaction();
id++;
// String query="select question,choicea,choiceb,choicec from student where id=:id";
// Query hql=sessin.createQuery(query).setParameter("id",id);
Quiz q=(Quiz) sessin.get(Quiz.class,id);
txtQuiz.setText(q.question);
c1.setText(q.getChoicea());
c2.setText(q.getChoiceb());
c3.setText(q.getChoicec());
sessin.close();
}