Issue
I added pagination to my JavaFX app and I'd like to remove this little number below page numbers. How can I do that?
my code:
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'.";
}
}
Main:
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();
}
}
Solution
You can do this with 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 ;");
}
Or, if you're using an external css file:
.pagination {
-fx-page-information-visible: false ;
}
Answered By - James_D