gpt4 book ai didi

java - 删除分页编号

转载 作者:行者123 更新时间:2023-12-01 19:29:08 24 4
gpt4 key购买 nike

我向 JavaFX 应用程序添加了分页,我想删除页码下方的这个小数字。我怎样才能做到这一点?

enter image description here

我的代码:

Controller :

public class ControllerAnswers {

@FXML
private ResourceBundle resources;

@FXML
private URL location;

@FXML
private Pagination pagination;

@FXML
void initialize() {
assert pagination != null : "fx:id=\"pagination\" was not injected: check your FXML file 'showAnswers.fxml'.";

}

}

主要:

public class Main extends Application {

public static void main(String[] args) {
launch(args);
}

@Override
public void start(Stage stage) throws IOException {


Parent root2 = FXMLLoader.load(getClass().getResource("fxml/showAnswers.fxml"));
Scene scene2 = new Scene(root2, 960,540);

stage.setScene(scene2);
stage.setMaximized(true);
stage.show();

}
}

最佳答案

您可以使用 CSS 来做到这一点:

@FXML
void initialize() {
assert pagination != null : "fx:id=\"pagination\" was not injected: check your FXML file 'showAnswers.fxml'.";
pagination.setStyle("-fx-page-information-visible: false ;");

}

或者,如果您使用外部 css 文件:

.pagination  {
-fx-page-information-visible: false ;
}

关于java - 删除分页编号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60351778/

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