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

[TableView, Cursor] Mouse flickers when resizing a table column

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u20
    • 7u45, 8
    • javafx
    • All

      If you run the code below, it displays a table with some columns.

      Move the mouse over the edge of a column and it changes the cursor to the resize icon. Press the mouse button down and drag and notice that the cursor flicks back and forth between the resize icon and the normal icon.

      This is caused by my least favorite bug (https://javafx-jira.kenai.com/browse/RT-34608) here.

      However, it should be easy to get round the problem in this case as you can "lock" the cursor to the resize icon when a user clicks down in the resize area and keep it that way until they release the mouse button.

      I expect what is happening at the moment is the cursor changes when it is over the resize area but because of the bug this lags behind where the cursor is when it is being resized.

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.TableColumn;
      import javafx.scene.control.TableView;
      import javafx.scene.layout.BorderPane;
      import javafx.stage.Stage;

      public class TableColumnResizeTest extends Application {
          @Override
          public void start(Stage stage) throws Exception {
              BorderPane pane = new BorderPane();
              Scene scene = new Scene(pane, 500, 500);
              stage.setScene(scene);

              TableView<String[]> table = new TableView<>();
              for (int i = 0; i < 4; i++) {
                  table.getColumns().add(new TableColumn<>("Column " + i));
              }

              pane.setCenter(table);
              stage.show();
          }

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

            msladecek Martin Sládeček
            ndarcy Nick D'Arcy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: