Example usage for javafx.scene.control TextArea getStyleClass

List of usage examples for javafx.scene.control TextArea getStyleClass

Introduction

In this page you can find the example usage for javafx.scene.control TextArea getStyleClass.

Prototype

@Override
    public final ObservableList<String> getStyleClass() 

Source Link

Usage

From source file:com.github.drbookings.ui.controller.MainController.java

private void showAbout() {

    final Alert alert = new Alert(AlertType.INFORMATION);
    alert.setTitle("About DrBookings");
    final TextArea label = new TextArea();

    label.setEditable(false);/* w ww . ja va 2 s  . c  o  m*/
    label.setPrefHeight(400);
    label.setPrefWidth(400);
    label.getStyleClass().add("copyable-label");

    final StringBuilder sb = new StringBuilder();

    try {
        sb.append("Application version\t").append(Manifests.read("Implementation-Version")).append("\n");
        sb.append("Build time\t\t").append(Manifests.read("Build-Time")).append("\n");
    } catch (final Exception e) {
        if (logger.isInfoEnabled()) {
            logger.error("Failed to add manifest entry", e.getLocalizedMessage());
        }
    }

    label.setText(sb.toString());
    alert.setHeaderText("proudly brought to you by kerner1000");
    alert.setContentText(null);
    alert.getDialogPane().setContent(label);
    alert.showAndWait();
}