gpt4 book ai didi

Javafx创建问卷答案界面

转载 作者:行者123 更新时间:2023-12-02 03:28:15 25 4
gpt4 key购买 nike

我有一个 javafx 项目,我想创建一个问卷 Pane 。事实上我想创造一个有问题和答案的场景。答案应该是从 1 到 10 的范围,例如 here 。到目前为止,我已经创建了一个 GridPane,其中包含问题和按钮作为答案,但是有更好的方法吗?

 BorderPane questionaires = new BorderPane();
GridPane questionnairesPane, questions;
questionaires.setTop(questionnairesPane);
questionaires.setCenter(questionsPane);
//QUESTIONS Panel
questionnairesPane = new GridPane();
questionnairesPane.setHgap(0);
questionnairesPane.setVgap(0);
questionnairesPane.setPadding(new Insets(0, 0, 0, 200));

results = new MyTitles("Questionnaires");
questionnairesPane.setStyle("-fx-font: 150 hamster; -fx-text-fill: white;");
questionnairesPane.add(results,1,1);

questionsPane = new GridPane();
questionsPane.setHgap(15);
questionsPane.setVgap(30);
questionsPane.setPadding(new Insets(0, 50, 0, 80));
SsubjectLabel = new Label("What was your affective response during the game?");
SsubjectLabel.setPrefWidth(1000.0);
SsubjectLabel.setPrefHeight(70.0);
SsubjectLabel.setStyle("-fx-font: 30 cornerstone; -fx-text-fill: black;");

boredom = new Button("Boredom");
boredom.setStyle("-fx-font: 30 cornerstone; -fx-text-fill: black;");
boredom.addEventHandler(ActionEvent.ACTION, (e)-> {
});
engagement = new Button("Boredom");
engagement.setStyle("-fx-font: 30 cornerstone; -fx-text-fill: black;");
engagement.addEventHandler(ActionEvent.ACTION, (e)-> {
});
frustration = new Button("Boredom");
frustration.setStyle("-fx-font: 30 cornerstone; -fx-text-fill: black;");
frustration.addEventHandler(ActionEvent.ACTION, (e)-> {
});
questions.add(SsubjectLabel,1,1);
questions.add(boredom,1,2);
questions.add(engagement,1,3);
questions.add(frustration,1,4);
questions.add(next,2,4);

这是我的代码,第一个边框 Pane 带有两个网格 Pane ,在第二个 Pane 中我有关于按钮的问题。如何代替按钮来获得刻度答案?

最佳答案

关于Javafx创建问卷答案界面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38482809/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com