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

JavaFX TreeTableView leaves icons behind when collapsing

    Details

    • Subcomponent:
    • Introduced In Version:
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_101"
      Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      windows 7 64 bit

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Seems the bug is similar to the one described in: https://bugs.openjdk.java.net/browse/JDK-8156049

      I can confirm that this bug started in release 1.8.0_92 and still exists in the current version. It was closed on the page...it shouldn't have been. the bug is still there.

      A DESCRIPTION OF THE PROBLEM :
      The bug is the same as described in: https://bugs.openjdk.java.net/browse/JDK-8156049

      it was closed, but I assure you this still exists.
      The treetable doesn't clean up the icons after the table is collapsed.

      This started in 1.8.0_92. I was hoping since the bug was filed it would be fixed, it hasn't yet, I checked the page for progress and it was closed.

      I'm confirming that this is a bug that wasn't fixed and I can reproduce it...

      REGRESSION. Last worked in version 8u91

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_101"
      Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      the original bug report describes how to reproduce it: https://bugs.openjdk.java.net/browse/JDK-8156049

      This shouldn't have been closed.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The images for the collapsed child nodes should disappear when the parent node is collapsed.
      ACTUAL -
      The icons of the collapsed nodes remain leaving a visual mess.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      no crash logs.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.beans.property.ReadOnlyStringWrapper;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.control.TreeTableColumn;
      import javafx.scene.control.TreeTableColumn.CellDataFeatures;
      import javafx.scene.control.TreeItem;
      import javafx.scene.control.TreeTableView;
      import javafx.stage.Stage;
      import javafx.scene.image.Image;
      import javafx.scene.image.ImageView;

      public class TreeTableViewSample extends Application {
          private static final Image icon = new Image(TreeTableViewSample.class.getResourceAsStream("icon.png"));

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

          @Override
          public void start(Stage stage) {
              stage.setTitle("Tree Table View Samples");
              final Scene scene = new Scene(new Group(), 200, 400);
              Group sceneRoot = (Group)scene.getRoot();

              //Creating tree items
              final TreeItem<String> childNode1 = new TreeItem<>("Child Node 1", new ImageView(icon));
              final TreeItem<String> childNode2 = new TreeItem<>("Child Node 2", new ImageView(icon));
              final TreeItem<String> childNode3 = new TreeItem<>("Child Node 3", new ImageView(icon));

              //Creating the root element
              final TreeItem<String> root = new TreeItem<>("Root node", new ImageView(icon));
              root.setExpanded(true);

              //Adding tree items to the root
              root.getChildren().setAll(childNode1, childNode2, childNode3);

              //Creating a column
              TreeTableColumn<String,String> column = new TreeTableColumn<>("Column");
              column.setPrefWidth(150);

              //Defining cell content
              column.setCellValueFactory((CellDataFeatures<String, String> p) ->
                  new ReadOnlyStringWrapper(p.getValue().getValue()));

              //Creating a tree table view
              final TreeTableView<String> treeTableView = new TreeTableView<>(root);
              treeTableView.getColumns().add(column);
              treeTableView.setPrefWidth(152);
              treeTableView.setShowRoot(true);
              sceneRoot.getChildren().add(treeTableView);
              stage.setScene(scene);
              stage.show();
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      none working for me.
      Fix the bug.

        Attachments

        1. Case-1.PNG
          Case-1.PNG
          11 kB
        2. Case-2.PNG
          Case-2.PNG
          14 kB
        3. TreeTableViewSample.java
          2 kB

          Issue Links

            Activity

              People

              • Assignee:
                kcr Kevin Rushforth
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: