This content has been marked as final. Show 1 reply
Here's my workaround for now:
I added a ChangeListener to the layoutBoundsProperty of the one of the component of the SplitPane (the one on which the position of the divider is based on). I suppose that when the layoutBounds changes and are greater than 0, the layout of all the other components inside the SplitPane is finished. Then I use a boolean flag to make sure that I compute the divider position only once, because I know that my listener will be called each time the main window/scene is resized.
This works for now, but I think it would still be easier to be notified when the internal layout() method has completed, instead of listening to the layoutBoundsProperty of one of the inner components. This would make sure that ALL the component are positions and sized based on either their explicit prefSize or their computed size, and that the getWidth() and getHeight() methods always returns the correct value.
Thanks again for your time.