0

In my project I have a gridpane of Hboxes, and directly adjacent to the bottom right box in the gridpane I'd like to add another pane with a label in it. This pane must always share the height of the GridPane's elements, and also share the same y axis coordinate as the bottom right element.

I tried to accomplish this by providing the gridpane's bottom right element the name "actionLabelPin" and providing the new pane the name "ActionLabel" and executing

actionLabel.prefHeightProperty().bind(actionLabelPin.heightProperty());

Though this doesn't work to bind the heights of the two containers.

Below is an image to help visualize the task I'm trying to accomplish, where the grey pane is "ActionLabel" and the box directly to the left is "actionLabelPin"

Image Link

Matt
  • 3,052
  • 1
  • 17
  • 30
  • 1
    [mcve] please .. – kleopatra Jan 25 '21 at 12:02
  • 4
    Don't use bindings to manage layout. Use an appropriate layout pane (`GridPane` in this case, I think) and set the layout properties to achieve what you want. – James_D Jan 25 '21 at 15:49
  • Check out this [link](https://stackoverflow.com/questions/32892646/adding-borders-to-gridpane-javafx) you can dynamically set the border of each cell in the `GridPane` by doing this you can get the look you are looking for by adding another column and only put a borders on cells you are using – Matt Jan 25 '21 at 19:32
  • Thank you for the help guys! By extending my GridPane and adding custom borders, It seems to be working the way I wanted :) – Justin DeWitt Jan 27 '21 at 08:37

0 Answers0