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

Table row selection stop working when resizing application window.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8u51
    • javafx
    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      Related bug:
      JDK-8087707 : Cannot select row in tableview when maximazing window

      I have to create new bug with different reproduction procedure as I was unable to add more comments to existing bug (perhaps Oracle should have easier interface if comment is allowed or add comment feature to bug reports)

      Beside maximizing the window as mentioned in the JDK-8087707 bug, resizing the window will create the same behavior.

      I filed this bugs months ago at the javafx support website which was recently closed so I assume java developer is either unable to reproduce this problem or ignore it due to importance level. As this affects user experience I can see frustration from time to time.

      REGRESSION. Last worked in version 8u60

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Basically run an application that has table.
      Either maximize or resize the window and try to select a row in the table.
      What I noticed was that when resizing, if you resize fast and release the mouse fast it will break easier.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      What I noticed is when it works I get 6 mouse events for every mouse press and release (three for mouse pressed and three for mouse release):

      MouseEvent [source = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', target = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', eventType = MOUSE_PRESSED, consumed = false, x = 123.0, y = 13.0, z = 0.0, button = PRIMARY, primaryButtonDown, pickResult = PickResult [node = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', point = Point3D [x = 123.0, y = 13.0, z = 0.0], distance = 2646.024022566334]

      MouseEvent [source = TableRow@50f6d74d[styleClass=cell indexed-cell table-row-cell]'null', target = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', eventType = MOUSE_PRESSED, consumed = false, x = 1052.0, y = 13.0, z = 0.0, button = PRIMARY, primaryButtonDown, pickResult = PickResult [node = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', point = Point3D [x = 123.0, y = 13.0, z = 0.0], distance = 2646.024022566334]

      MouseEvent [source = RackUnitTable[id=Aos_RUTable_Delete, styleClass=table-view column-header-background], target = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', eventType = MOUSE_PRESSED, consumed = false, x = 1052.0, y = 181.0, z = 0.0, button = PRIMARY, primaryButtonDown, pickResult = PickResult [node = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', point = Point3D [x = 123.0, y = 13.0, z = 0.0], distance = 2646.024022566334]

      MouseEvent [source = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', target = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', eventType = MOUSE_RELEASED, consumed = false, x = 123.0, y = 13.0, z = 0.0, button = PRIMARY, pickResult = PickResult [node = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', point = Point3D [x = 123.0, y = 13.0, z = 0.0], distance = 2646.024022566334]

      MouseEvent [source = TableRow@50f6d74d[styleClass=cell indexed-cell table-row-cell]'null', target = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', eventType = MOUSE_RELEASED, consumed = false, x = 1052.0, y = 13.0, z = 0.0, button = PRIMARY, pickResult = PickResult [node = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', point = Point3D [x = 123.0, y = 13.0, z = 0.0], distance = 2646.024022566334]

      MouseEvent [source = RackUnitTable[id=Aos_RUTable_Delete, styleClass=table-view column-header-background], target = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', eventType = MOUSE_RELEASED, consumed = false, x = 1052.0, y = 181.0, z = 0.0, button = PRIMARY, pickResult = PickResult [node = TableColumn$1$1[id=null, styleClass=cell indexed-cell table-cell table-column]'Rack Unit', point = Point3D [x = 123.0, y = 13.0, z = 0.0], distance = 2646.024022566334]



      ACTUAL -
      When it breaks, I only see 4 events (two mouse pressed and two mouse released). The mouse pressed and mouse release event for the Column is missing:

      MouseEvent [source = TableRow@3a64acd3[styleClass=cell indexed-cell table-row-cell]'null', target = TableRow@3a64acd3[styleClass=cell indexed-cell table-row-cell]'null', eventType = MOUSE_PRESSED, consumed = false, x = 707.0, y = 7.0, z = 0.0, button = PRIMARY, primaryButtonDown, pickResult = PickResult [node = TableRow@3a64acd3[styleClass=cell indexed-cell table-row-cell]'null', point = Point3D [x = 707.0, y = 7.0, z = 0.0], distance = 1968.6568009925832]

      MouseEvent [source = RackUnitTable[id=Aos_RUTable_Delete, styleClass=table-view column-header-background], target = TableRow@3a64acd3[styleClass=cell indexed-cell table-row-cell]'null', eventType = MOUSE_PRESSED, consumed = false, x = 707.0, y = 151.0, z = 0.0, button = PRIMARY, primaryButtonDown, pickResult = PickResult [node = TableRow@3a64acd3[styleClass=cell indexed-cell table-row-cell]'null', point = Point3D [x = 707.0, y = 7.0, z = 0.0], distance = 1968.6568009925832]

      MouseEvent [source = TableRow@3a64acd3[styleClass=cell indexed-cell table-row-cell]'null', target = TableRow@3a64acd3[styleClass=cell indexed-cell table-row-cell]'null', eventType = MOUSE_RELEASED, consumed = false, x = 707.0, y = 7.0, z = 0.0, button = PRIMARY, pickResult = PickResult [node = TableRow@3a64acd3[styleClass=cell indexed-cell table-row-cell]'null', point = Point3D [x = 707.0, y = 7.0, z = 0.0], distance = 1968.6568009925832]

      MouseEvent [source = RackUnitTable[id=Aos_RUTable_Delete, styleClass=table-view column-header-background], target = TableRow@3a64acd3[styleClass=cell indexed-cell table-row-cell]'null', eventType = MOUSE_RELEASED, consumed = false, x = 707.0, y = 151.0, z = 0.0, button = PRIMARY, pickResult = PickResult [node = TableRow@3a64acd3[styleClass=cell indexed-cell table-row-cell]'null', point = Point3D [x = 707.0, y = 7.0, z = 0.0], distance = 1968.6568009925832]


      Further digging I see that when it is in broken mode, the Node.processCSS() was not called which in turn does not register the column to mouse event therefore the BehaviorSkinBase.mouseHandler did not get called for the column when mouse pressed.

      REPRODUCIBILITY :
      This bug can be reproduced often.

      ---------- BEGIN SOURCE ----------
      I will copy the code from JDK-8087707 bug:

      import javafx.application.Application;
      import javafx.beans.property.SimpleStringProperty;
      import javafx.collections.FXCollections;
      import javafx.collections.ObservableList;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.control.TableColumn;
      import javafx.scene.control.TableView;
      import javafx.scene.control.cell.PropertyValueFactory;
      import javafx.scene.layout.HBox;
      import javafx.scene.text.Font;
      import javafx.stage.Stage;
       
      public class table extends Application {
          HBox root = new HBox();
          private TableView<Person> table = new TableView<Person>();
          private final ObservableList<Person> data =
              FXCollections.observableArrayList(
                  new Person("Jacob", "Smith", "jacob.smith@example.com"),
                  new Person("Isabella", "Johnson", "isabella.johnson@example.com"),
                  new Person("Ethan", "Williams", "ethan.williams@example.com"),
                  new Person("Emma", "Jones", "emma.jones@example.com"),
                  new Person("Michael", "Brown", "michael.brown@example.com")
              );
       
          public static void main(String[] args) {
              launch(args);
          }
       
          @Override
          public void start(Stage stage) {
              Scene scene = new Scene(new Group());
              double weight = scene.getWidth();;
              double height=scene.getHeight();
              stage.setTitle("Table View Sample");
              stage.setWidth(weight);
              stage.setHeight(height);
              table.setEditable(true);
              TableColumn firstNameCol = new TableColumn("First Name");
              firstNameCol.setMinWidth(500);
              firstNameCol.setCellValueFactory(
                      new PropertyValueFactory<Person, String>("firstName"));
       
              TableColumn lastNameCol = new TableColumn("Last Name");
              lastNameCol.setMinWidth(500);
              lastNameCol.setCellValueFactory(
                      new PropertyValueFactory<Person, String>("lastName"));
       
              TableColumn emailCol = new TableColumn("Email");
              emailCol.setMinWidth(1000);
              emailCol.setCellValueFactory(
                      new PropertyValueFactory<Person, String>("email"));
       
              table.setItems(data);
              table.getColumns().addAll(firstNameCol, lastNameCol, emailCol);
              root.getChildren().addAll(table);
              scene = new Scene(root, weight, height, true);
              stage.setScene(scene);
              stage.show();
          }
       
          public static class Person {
       
              private final SimpleStringProperty firstName;
              private final SimpleStringProperty lastName;
              private final SimpleStringProperty email;
       
              private Person(String fName, String lName, String email) {
                  this.firstName = new SimpleStringProperty(fName);
                  this.lastName = new SimpleStringProperty(lName);
                  this.email = new SimpleStringProperty(email);
              }
       
              public String getFirstName() {
                  return firstName.get();
              }
       
              public void setFirstName(String fName) {
                  firstName.set(fName);
              }
       
              public String getLastName() {
                  return lastName.get();
              }
       
              public void setLastName(String fName) {
                  lastName.set(fName);
              }
       
              public String getEmail() {
                  return email.get();
              }
       
              public void setEmail(String fName) {
                  email.set(fName);
              }
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Resize window until it works.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: