سؤال

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.

هل كانت مفيدة؟

المحلول

From the TextFlow documentation:

The wrapping width of the layout is determined by the region's current width. It can be specified by the application by setting the textflow's preferred width. If no wrapping is desired, the application can either set the preferred with to Double.MAX_VALUE or Region.USE_COMPUTED_SIZE.

So, to stop a TextFlow from wrapping:

textFlow.setPrefWidth(Region.USE_COMPUTED_SIZE);

نصائح أخرى

You can wrap a textflow in a scrollpane because scrollpane layout is calculated by its child nodes .

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top