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

Reordering tabs of TabPane changes mouse offset

XMLWordPrintable

    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10. Java 15.

      A DESCRIPTION OF THE PROBLEM :
      If I set TabPane to be reorderable, and start dragging a Tab and move the mouse violently to the left and right for some time (without releasing the mouse), the mouse x-offset will change.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create a TabPane.
      2. Add some tabs.
      3. Start dragging one tab.
      4. Move the mouse to the right and to the left for some time (quite rapidly)
      5. You will notice that the X-offset "goes off" when doing this.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The mouse X-offset should stay where it was when the drag started.
      ACTUAL -
      The mouse X-offset changes.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Tab;
      import javafx.scene.control.TabPane;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      public class Test extends Application {

          @Override
          public void start(Stage primaryStage) {
              TabPane tabPane = new TabPane();
              tabPane.setTabDragPolicy(TabPane.TabDragPolicy.REORDER);

              tabPane.getTabs().add(new Tab("First"));
              tabPane.getTabs().add(new Tab("Second"));
              tabPane.getTabs().add(new Tab("Third"));
              tabPane.getTabs().add(new Tab("Fourth"));
              tabPane.getTabs().add(new Tab("Fifth"));

              StackPane root = new StackPane();
              root.getChildren().add(tabPane);

              Scene scene = new Scene(root, 300, 250);

              primaryStage.setTitle("TabPane bug");
              primaryStage.setScene(scene);
              primaryStage.show();
          }
          public static void main(String[] args) {
              launch(args);
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None that I know of.

      FREQUENCY : always


        1. Capture.JPG
          Capture.JPG
          48 kB
        2. Test.java
          1.0 kB

            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: