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

Empty Cells in TableView supposedly after using setFixedCellSize()

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10 x64

      A DESCRIPTION OF THE PROBLEM :
      when I use setFixedCellSize() to set the row height of a table, and then pan around that table for a while, empty cells will appear. Most of the time complete rows in the table will be empty. Panning the table right or left just one pixel will make the cells appear again, whereas panning up and down does not.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      run the provided code, then pan around the table, drag the scrollbar thumbs around, left, up, down, right, left, etc., you will see empty cells at some point



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      cell content should always appear in designated cell
      ACTUAL -
      some rows of cells are empty

      ---------- BEGIN SOURCE ----------
      package application;

      import java.util.stream.IntStream;

      import javafx.application.Application;
      import javafx.beans.property.SimpleStringProperty;
      import javafx.collections.FXCollections;
      import javafx.collections.ObservableList;
      import javafx.scene.Scene;
      import javafx.scene.control.TableColumn;
      import javafx.scene.control.TableView;
      import javafx.stage.Stage;

      public class TableCellTest extends Application {

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

      @Override public void start(Stage stage) throws Exception {
      int numCols = 125;
      int numRows = 75;

      ObservableList<Integer> rows = FXCollections.observableList(IntStream.rangeClosed(1, numRows).boxed().toList());
      TableView<Integer> tv = new TableView<>(rows);
      for (int i = 1; i <= numCols; i++) {
      String str = "";
      int k = i;
      while (k > 0) {
      k--;
      str = Character.toString(k % 26 + 65) + str;
      k /= 26;
      }

      TableColumn<Integer, String> col = new TableColumn<>(str);
      String str2 = str;
      col.setCellValueFactory(cdf -> new SimpleStringProperty(str2 + cdf.getValue().toString()));
      tv.getColumns().add(col);
      }

      tv.setFixedCellSize(22); //----------------------------
      Scene scene = new Scene(tv, 900, 600);
      stage.setScene(scene);
      stage.show();
      }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      apparendtly do not use setFixedCellSize()

      FREQUENCY : always


      Attachments

        1. TableCellTest.java
          1 kB
        2. Capture.PNG
          Capture.PNG
          615 kB
        3. Capture_100%.png
          Capture_100%.png
          68 kB

        Activity

          People

            kpk Karthik P K
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: