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

GridPane: baseline row alignment leads to overlapping cells


    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: fx2.1
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Environment:

      JavaFX 2.1 64bit on JRE 1.6.0_30-b12, Win7 64bit


      GridPane with a 3-row 2-column layout. First two rows should get a BASELINE valignment. The baseline is considered but the controls overlap each other. With valignment TOP there is no overlap but of course the baseline looks bad. Might be related to http://javafx-jira.kenai.com/browse/RT-11711

      Note about the screenshots: this is a VBox with two children. First child is the label "Configuration". Second child is the GridPane.

      FXML excerpt:

        <VBox fx:id="vbConfig" visible="false" managed="${vbConfig.visible}" spacing="8" fillWidth="true">
            <Insets left="8" right="8"/>
          <Label text="Configuration"/> <!-- style: full width header -->
          <GridPane hgap="8" vgap="16">
              <ColumnConstraints halignment="RIGHT"/>
              <ColumnConstraints fillWidth="true"/>
              <RowConstraints valignment="BASELINE"/>
              <RowConstraints valignment="BASELINE"/>
              <RowConstraints valignment="TOP"/>
            <Label text="Chart type" GridPane.rowIndex="0" GridPane.columnIndex="0"/>
            <ComboBox fx:id="cbChartType" editable="false" onAction="#chartTypeSelected" HBox.hgrow="ALWAYS" maxWidth="140" GridPane.rowIndex="0" GridPane.columnIndex="1"/>
            <Label text="Reports rows" GridPane.rowIndex="1" GridPane.columnIndex="0"/>
            <HBox spacing="8" alignment="BASELINE_LEFT" GridPane.rowIndex="1" GridPane.columnIndex="1">
              <RadioButton fx:id="rbSummary" text="Summary rows" toggleGroup="$tgRowSelection" selected="true" onAction="#rowTypeSelected"/>
              <Region minWidth="16"/>
              <RadioButton fx:id="rbValue" text="Value rows with property" toggleGroup="$tgRowSelection" onAction="#rowTypeSelected"/>
              <ComboBox fx:id="cbPropertyColumn" editable="false" onAction="#propertyColumnSelected" HBox.hgrow="ALWAYS" disable="${rbSummary.selected}" prefWidth="140" maxWidth="300"/>
            <Label text="Report columns" GridPane.rowIndex="2" GridPane.columnIndex="0"/>
            <ListView fx:id="lvDataColumns" editable="false" minHeight="100" maxHeight="100" HBox.hgrow="ALWAYS" maxWidth="600" GridPane.rowIndex="2" GridPane.columnIndex="1"/>


        1. alignment_baseline_gridlines.png
          11 kB
          Werner Lehmann
        2. alignment_baseline_vgap_8.png
          11 kB
          Werner Lehmann
        3. alignment_baseline.png
          11 kB
          Werner Lehmann
        4. alignment_top_gridlines.png
          12 kB
          Werner Lehmann
        5. alignment_top.png
          11 kB
          Werner Lehmann

          Issue Links



              • Assignee:
                ekrejcir Eva Krejčířová (Inactive)
                wlehmann Werner Lehmann
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: