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

Cursor change not applyed immediatly

XMLWordPrintable

      Glass mode handles cursor changes incorrectly
      In these code fragment I try to change cursor shape according to application state. However application behaves as expected as when button is pressed there is no change until I release the button, when is cursor changed to "hand" shape, another press change it to "Default" and release back to "Hand" - basically oposit of expected behaviour. When you move cursor while in (wrong) "Hand" mode it will change to "Default" shape.

      Swing mode doesn't help much either. It doesn't change to the wrong shape but you must move mouse to get the proper shape

      whiteRect.setOnMousePressed(new MouseListener() {
                  public void onEvent(MouseEvent me) {
                      whiteRect.setCursor(Cursor.HAND);
                  }
              });
      whiteRect.setOnMouseReleased(new MouseListener() {
                  public void onEvent(MouseEvent me) {
                      whiteRect.setCursor(Cursor.DEFAULT);
                  }
              });

            Unassigned Unassigned
            lwaldmannjfx Lukas Waldmann (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: