1

I have a splitpane with three children, but I want to show just the 2 top or the 2 bottom children at a time. So I implement a sliding animation, which slide the splitpane in a parent pane up and down. The sliding animation works fine, but when I resize the parent pane I have a problem with the divider positions. How can I make sure, that the divider positions are always correct? The image should makes my idea clear. enter image description here

Studiosus
  • 143
  • 1
  • 11

1 Answers1

1

Do you want to force the divider to always stay in the middle? You can use highlevel binding:

splitPane.getDividers().get(0).positionProperty()
            .bind(splitPane.heightProperty().divide(2));

Hope this helps.

Muten Roshi
  • 493
  • 2
  • 5
  • 17