FlowPane inside ScrollPane - how to force wrapping and vertical scrolling?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

FlowPane inside ScrollPane - how to force wrapping and vertical scrolling?

Andrey Popchansky
I want to make contents of a FlowPane to scroll vertically, but not horizontally (if another child doesn't fit in width, go to next row). The obvious one doesn't work - it simply disables scrollbar, but no wrapping is done, elements get clipped on the right side:

<Window bxml:id="window" maximized="true"
    xmlns:bxml="http://pivot.apache.org/bxml" xmlns="org.apache.pivot.wtk">

    <ScrollPane>
        <horizontalScrollBarPolicy> NEVER </horizontalScrollBarPolicy>
        <FlowPane>

<!--        Lots of components here...  -->

        </FlowPane>
    </ScrollPane>

</Window>
What is the simplest way to do this?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: FlowPane inside ScrollPane - how to force wrapping and vertical scrolling?

Roger Whitcomb-2

Try using “FILL” for the “horizontalScrollBarPolicy”.  If you read the Javadoc for NEVER it says:   Never show the scroll bar, and don't affect the layout of the pane's content.

Since you do want the layout to be affected, then FILL should work.

 

HTH,

~Roger Whitcomb

 

From: Andrey Popchansky [mailto:[hidden email]]
Sent: Friday, June 28, 2013 7:32 AM
To: [hidden email]
Subject: FlowPane inside ScrollPane - how to force wrapping and vertical scrolling?

 

I want to make contents of a FlowPane to scroll vertically, but not horizontally (if another child doesn't fit in width, go to next row). The obvious one doesn't work - it simply disables scrollbar, but no wrapping is done, elements get clipped on the right side:

<Window bxml:id="window" maximized="true"
    xmlns:bxml="http://pivot.apache.org/bxml" xmlns="org.apache.pivot.wtk">
 
    <ScrollPane>
        <horizontalScrollBarPolicy> NEVER </horizontalScrollBarPolicy>
        <FlowPane>
 
<!--        Lots of components here...  -->
 
        </FlowPane>
    </ScrollPane>
 
</Window>

What is the simplest way to do this?

Loading...