Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8115752

HBox does not correctly calculate it's prefHeight when it contains a multi-line Label

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • fx2.1
    • fx2.0
    • javafx
    • JavaFX2.0 JDK7u2b8

      Steps to reproduce:

      1. Create a HBox inside a VBox.
      2. Place a small circle and a taller multi-line label in the HBox.
      3. The HBox's prefHeight will be set to the height of the small circle, rather than the taller multi-line label.

      My reading of the HBox documentation (in this case) is that the HBox's parent should resize the HBox during layout to the top/bottom insets plus the largest of the children's pref heights.

      As a workaround, you can bind the multi-line label's prefWidth to a calculated value, then the HBox will resize it's prefHeight correctly.

            kwwong Kinsley Wong (Inactive)
            josmithjfx John Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: