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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.0
    • Fix Version/s: fx2.1
    • Component/s: javafx
    • Labels:
    • Environment:

      JavaFX2.0 JDK7u2b8

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Due:
              Created:
              Updated:
              Resolved:
              Imported: