Example usage for javafx.scene.control Label isWrapText

List of usage examples for javafx.scene.control Label isWrapText

Introduction

In this page you can find the example usage for javafx.scene.control Label isWrapText.

Prototype

public final boolean isWrapText() 

Source Link

Usage

From source file:de.micromata.mgc.javafx.FXGuiUtils.java

/**
 * Computes the required height of the label to fully render its text.
 * /*from  w ww.  ja v  a2  s. co m*/
 * @param width used if the {@link Label#wrapTextProperty()} is true. Then this value is the max line width when the
 *          text needs to be wrapped.
 * @param msg the label.
 * @return required height.
 */
public static double computeLabelHeight(double width, Label msg) {
    final Font font = msg.getFont();
    final String str = msg.getText();
    return computeTextHeight(font, str, msg.isWrapText() ? width : 0);
}