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

TableView in SplitPane not rendered correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8u65
    • javafx
    • x86
    • os_x

      FULL PRODUCT VERSION :
      java version "1.8.0_65"
      Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Darwin xxx.local 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      Tableview is not rendered correctly. After moving splitpane divider to left, you can see that all columns which has been invisible before are not correctly rendered. Only the first row is visible.

      After moving the scrollbar or resizing window, everything is ok again.

      Please see the following test case.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Start test app
      2) Move Splitpane slider to left or right
      3) see how the columns look like, which have been invisible before

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      all columns should be rendered correctly
      ACTUAL -
      not all columns are rendered correctly

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package at.test;

      import javafx.application.Application;
      import javafx.geometry.Orientation;
      import javafx.scene.Scene;
      import javafx.scene.control.SplitPane;
      import javafx.scene.control.TableColumn;
      import javafx.scene.control.TableView;
      import javafx.scene.control.cell.PropertyValueFactory;
      import javafx.stage.Stage;

      public class TestTrailingCells extends Application {


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

          @Override
          public void start(Stage primaryStage) throws Exception {


              Stage stage = new Stage();
              SplitPane pane = new SplitPane();
              pane.setOrientation(Orientation.HORIZONTAL);
              stage.setScene(new Scene(pane, 600, 200));
              stage.show();

              pane.getItems().addAll(createTable("abcd", "efgh"), createTable("abcd1", "efgh1"));
          }

          private TableView createTable(String data1, String data2) {
              TableView table = new TableView();
              table.setStyle("-fx-fixed-cell-size: 35;");

              table.getColumns().add(getColumn("prop1"));
              table.getColumns().add(getColumn("prop2"));
              table.getColumns().add(getColumn("prop3"));
              table.getColumns().add(getColumn("prop4"));
              table.getColumns().add(getColumn("prop5"));
              table.getColumns().add(getColumn("prop6"));
              table.getColumns().add(getColumn("prop7"));
              table.getColumns().add(getColumn("prop8"));
              table.getColumns().add(getColumn("prop9"));
              table.getColumns().add(getColumn("prop10"));

              table.getItems().add(new MyDataClass(data1));
              table.getItems().add(new MyDataClass(data2));

              return table;
          }

          private static TableColumn<Object, Object> getColumn(String prop) {
              TableColumn<Object, Object> tableColumn = new TableColumn<>(prop);
              tableColumn.setCellValueFactory(new PropertyValueFactory<Object, Object>(prop));
              tableColumn.setStyle("-fx-border-color: red; -fx-border-width: 0 1px 0 0;");
              return tableColumn;
          }

          public class MyDataClass {
              private String prop1, prop2, prop3, prop4, prop5, prop6, prop7, prop8, prop9, prop10;

              public MyDataClass(String prefix) {
                  this.prop1 = prefix + "1";
                  this.prop2 = prefix + "2";
                  this.prop3 = prefix + "3";
                  this.prop4 = prefix + "4";
                  this.prop5 = prefix + "5";
                  this.prop6 = prefix + "6";
                  this.prop7 = prefix + "7";
                  this.prop8 = prefix + "8";
                  this.prop9 = prefix + "9";
                  this.prop10 = prefix + "10";
              }

              public String getProp1() {
                  return prop1;
              }

              public String getProp2() {
                  return prop2;
              }

              public String getProp3() {
                  return prop3;
              }

              public String getProp4() {
                  return prop4;
              }

              public String getProp5() {
                  return prop5;
              }

              public String getProp6() {
                  return prop6;
              }

              public String getProp7() {
                  return prop7;
              }

              public String getProp8() {
                  return prop8;
              }

              public String getProp9() {
                  return prop9;
              }

              public String getProp10() {
                  return prop10;
              }
          }

      }

      ---------- END SOURCE ----------

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

              Created:
              Updated:
              Resolved: