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

Double click is not being caught by OnMouseEvent (JavaFX2)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 7u6
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
    • Environment:

      windows XP, Netbeans 7.2 Java 7

      Description

      Double clicks are being captured as single click :(

      In fxml file:

      <Button fx:id="A_button" onMouseClicked="#buttonAClicked">
      In the controller

      private void buttonAClicked(MouseEvent mouseEvent) {
          if (mouseEvent.getButton().equals(MouseButton.PRIMARY)) {
              if (mouseEvent.getClickCount() == 2) {
                  System.out.println("Double clicked A_button");
              }
              if (mouseEvent.getClickCount() == 1) {
                  System.out.println("Single clicked A_button");
              }
          }
      }
      Unfortunately I am finding that double click is not being caught - only single clicks. In the debugger, click count is 1.

        Attachments

          Activity

            People

            • Assignee:
              lnerad Ľubomír Nerád
              Reporter:
              aphilipjfx Anil Philip (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: