0

I am trying to work out how many Anchor Panes have been fitted onto a single row of a FlowPane

My current solution would involve simply counting the number of Anchorpanes on a single row. However for this I need to know the Y coordinate of each one of those Anchorpanes.

Is there a way to find out the y coordinate of an AnchorPane that has been added to a flow pane?

I keep getting 0.0 using getLayoutY(), getScaleY(), or getTranslateY() even if it is on the second row.

NODE: Deviding Flow Pane width by the AnchorPane width doesn't really work because of extra complexities such as: if the FlowPane is inside of a ScrollPane then some of that width is taken up by the scroll bar

user1488773
  • 77
  • 10
  • 1
    `getLayoutY()` should work. Post a [MCVE]. – James_D Jul 15 '16 at 15:56
  • To add to James_D's comment: You may need to generate a layout pass or use some other way to make sure the layout has been done, see this question: http://stackoverflow.com/questions/26152642/get-the-height-of-a-node-in-javafx-generate-a-layout-pass – fabian Jul 15 '16 at 16:46
  • Thank you fabian that thread showed me the reason why I wasn't getting the coords that I was expecting – user1488773 Jul 15 '16 at 19:36

0 Answers0