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

TableColumn header height does not shrink when removing nested TableColumns

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u40
    • Fix Version/s: 9
    • Component/s: javafx
    • Labels:
    • Subcomponent:
    • Introduced In Version:
    • CPU:
      x86
    • OS:
      windows_2008

      Backports

        Description

        FULL PRODUCT VERSION :
        jdk1.8.0_45-i586-b14

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.1.7601]

        A DESCRIPTION OF THE PROBLEM :
        If nested TableColumns are added to a TableView, and then those TableColumns are replaced by TableColumns without nesting, the height of the column header will still remain the same height as the original nested columns.

        REGRESSION. Last worked in version 8u31

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Execute the code below and then press the button.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The nested column headers will get replaced by a single column header with the height of a single column header.
        ACTUAL -
        The nested column headers will get replaced by a single column header with the height of two column headers.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        public class Test extends Application {

        @Override
        public void start(Stage primaryStage) throws Exception {
        TableColumn childCol = new TableColumn("Child");
        TableColumn parentCol = new TableColumn("Parent");
        parentCol.getColumns().add(childCol);
        TableView tableView = new TableView();
        Button button = new Button("Change column header");
        button.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent arg0) {
        // Replace with single column header after showing the stage
        tableView.getColumns().setAll(childCol);
        // You will see that the single column header is still the same
        // height as the nested column header was
        }
        });
        VBox vbox = new VBox();
        vbox.getChildren().addAll(tableView, button);
        primaryStage.setScene(new Scene(vbox));
        primaryStage.show();
        tableView.getColumns().setAll(parentCol);
        }

        public static void main(String[] args) {
        launch(args);
        }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Recreate the TableView every time I need to change the column headers.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                jgiles Jonathan Giles
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: