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

JavaFX wrong hover-behavior for hyperlinks in popupwindow

XMLWordPrintable

    • generic
    • generic

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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      If a Hyperlink is hovered, the mouse cursor changes from a normal mouse cursor to a hand like mouse cursor. There is a difference in hover-behavior between a hyperlink in a scene and a hyperlink in a popup window. If the mouse cursor hovers over a hyperlink in a normal scene an imaginary rectangle is used in background to change the mouse cursor into a hand mouse cursor, BUT in PopupWindow case the mouse cursor changes to a hand mouse cursor only if the mouse is exactly above the rendered pixels of the hyperlink text.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Start the example code. Click on "Open Popup"-Button. Now move the mouse above the two hyperlinks. You will see the difference in hover behavior for mouse cursor change.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Same behavior in both cases.
      ACTUAL -
      See description.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class JavaFXPopupWindowExample extends Application {

        @Override
        public void start(Stage primaryStage) throws Exception {
          final Button openPopupButton = new Button("Open Popup");
          openPopupButton.setOnAction(event -> {
            final Bounds boundsInLocal = openPopupButton.localToScreen(openPopupButton.getBoundsInLocal());
            new MyPopup().show(openPopupButton, boundsInLocal.getMaxX(), boundsInLocal.getMinY());
          });

          final VBox vBox = new VBox();
          vBox.getChildren().add(openPopupButton);
          vBox.getChildren().add(new Hyperlink("OOO"));

          primaryStage.setScene(new Scene(vBox, 500, 300));
          primaryStage.show();
        }

        private static final class MyPopup extends PopupWindow {
          MyPopup() {
            ((Pane)(this.getScene().getRoot())).getChildren().add(new Hyperlink("OOO"));
          }
        }
      }
      ---------- END SOURCE ----------

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

              Created:
              Updated: