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

Garbled displaying when moving a TableView column, for which a context menu is opened

XMLWordPrintable

    • x86_64
    • windows_7

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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]
      Windows 7 x86_64

      A DESCRIPTION OF THE PROBLEM :
      In the application we use context menu on TableView headers. I noticed, that when I slightly misclick with the mouse, the column displaying becomes garbled and do not react on clicks anymore.

      Siehe attached test case to reproduce the issue.
      When run, open the context menu for any column (right click on the table header), then try to move the same column slightly left or right with the mouse. Contrary to the expectation, the context menu does not get closed and the column displaying stucks in the "drag&drop appearance", also light dimmed and displaced. The context menu can be operated further but even after the menu is closed this greyed area remains and left/right clicks on it cause seemingly no reaction.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Start the test case
      2) right click on any column header area, context menu is opened
      3) now drag the same column slightly to the left or to the right

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      menu closed, column not moved (not enough movement to be swapped with any other)
      ACTUAL -
      menu still opened, column stuck in drag&drop animation, grey area accepts no further clicks

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.ContextMenu;
      import javafx.scene.control.MenuItem;
      import javafx.scene.control.TableColumn;
      import javafx.scene.control.TableView;
      import javafx.stage.Stage;

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

          private TableView<Integer> table;

          @Override
          public void start(Stage primaryStage) {
              table = new TableView<>();
              
              for (int j=0; j<5; j++) {
                  TableColumn<Integer, String> col = new TableColumn<>(String.format("Col %d", j));
                  table.getColumns().add(col);
                  ContextMenu menu = new ContextMenu();
                  menu.getItems().addAll(new MenuItem("aaa"), new MenuItem("bbb"));
                  col.setContextMenu(menu);
              }

              Scene scene = new Scene(table, 500, 475);
              primaryStage.setScene(scene);
              primaryStage.show();
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No workaround to prevent this so far.
      Stuck table column can be 'unstuck' by moving another column.

        1. 8.png
          8.png
          51 kB
        2. 8u102ea.png
          8u102ea.png
          49 kB
        3. 8u92.png
          8u92.png
          50 kB
        4. FXTableViewExample8.java
          1 kB

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

              Created:
              Updated:
              Resolved: