Example usage for javafx.scene.text Font getFamilies

List of usage examples for javafx.scene.text Font getFamilies

Introduction

In this page you can find the example usage for javafx.scene.text Font getFamilies.

Prototype

public static List<String> getFamilies() 

Source Link

Document

Gets all the font families installed on the user's system, including any application fonts or SDK fonts.

Usage

From source file:Main.java

@Override
public void start(final Stage stage) throws Exception {
    fonts = Font.getFamilies().toArray(fonts);
    pagination = new Pagination(fonts.length / itemsPerPage(), 0);
    pagination.setPageFactory((Integer pageIndex) -> createPage(pageIndex));

    AnchorPane anchor = new AnchorPane();
    AnchorPane.setTopAnchor(pagination, 10.0);
    AnchorPane.setRightAnchor(pagination, 10.0);
    AnchorPane.setBottomAnchor(pagination, 10.0);
    AnchorPane.setLeftAnchor(pagination, 10.0);
    anchor.getChildren().addAll(pagination);
    Scene scene = new Scene(anchor, 400, 450);
    stage.setScene(scene);/*  w w w  .j a v a 2  s  .  c o m*/
    stage.show();
}