There is such a FlowPane: There is such a FlowPane

When many objects are added to it, the following happens: Problem = (

How to make it so that the objects could not expand it, and when there is not enough space, will ScrollBar appear or how can it be there and then can it be scrolled further?

    1 answer 1

    Let there be a FlowPane with fx:id="myFlowPane" .

    1. <ScrollPane fx:id="myScrollPane"/> line <ScrollPane fx:id="myScrollPane"/> into the markup file (as a child of the root element).

    2. In the controller add field @FXML ScrollPane myScrollPane; .

    3. Add the string myScrollPane.setContent(myFlowPane); controller's initialize() method myScrollPane.setContent(myFlowPane); . Here you can customize your ScrollPane .

    • I didn’t understand much at first, but then the essence came to me. I created a ScrollPane and made it a child of FlowPane and it turned out what was needed. God, how simple. All day tormented. - Prototype