Example usage for javafx.scene.control Tooltip wrapTextProperty

List of usage examples for javafx.scene.control Tooltip wrapTextProperty

Introduction

In this page you can find the example usage for javafx.scene.control Tooltip wrapTextProperty.

Prototype

public final BooleanProperty wrapTextProperty() 

Source Link

Document

If a run of text exceeds the width of the Tooltip, then this variable indicates whether the text should wrap onto another line.

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setWidth(300);/*  w ww . ja  va  2  s.  c  om*/
    stage.setHeight(150);

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");
    toolTip.setWrapText(true);
    System.out.println(toolTip.wrapTextProperty());

    button.setTooltip(toolTip);

    ((Group) scene.getRoot()).getChildren().add(button);

    stage.setScene(scene);
    stage.show();
}