3

I using TextFlow object as the graphic node for a CheckBoxTextItem (from controlsFX). If the TextFlow object is longer the width of the tree view, it gets wrapped. How can I stop the wrapping? or set something like an Ellipsis String-- like what you can do with Labels?

The text flow object is made up of Text objects.

4

1 回答 1

5

来自TextFlow文档:

布局的环绕宽度由区域的当前宽度决定。它可以由应用程序通过设置文本流的首选宽度来指定。如果不需要包装,应用程序可以将首选参数设置为 Double.MAX_VALUE 或 Region.USE_COMPUTED_SIZE。

因此,要阻止 TextFlow 包装:

textFlow.setPrefWidth(Region.USE_COMPUTED_SIZE);
于 2014-04-19T07:25:49.907 回答