< prev index next >

modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java

Print this page
*** 445,11 ***
          if ((e.getID() == MouseEvent.MOUSE_PRESSED) &&
              (e.getButton() == MouseEvent.BUTTON1)) {
              if (isFocusable() && !hasFocus()) {
                  requestFocus();
                  // This fixes JDK-8087914 without causing JDK-8200224
!                 // It is save, because in JavaFX only the method "setFocused(true)" is called,
                  // which doesn't have any side-effects when called multiple times.
                  int focusCause = AbstractEvents.FOCUSEVENT_ACTIVATED;
                  stagePeer.setFocused(true, focusCause);
              }
          }
--- 445,11 ---
          if ((e.getID() == MouseEvent.MOUSE_PRESSED) &&
              (e.getButton() == MouseEvent.BUTTON1)) {
              if (isFocusable() && !hasFocus()) {
                  requestFocus();
                  // This fixes JDK-8087914 without causing JDK-8200224
!                 // It is safe, because in JavaFX only the method "setFocused(true)" is called,
                  // which doesn't have any side-effects when called multiple times.
                  int focusCause = AbstractEvents.FOCUSEVENT_ACTIVATED;
                  stagePeer.setFocused(true, focusCause);
              }
          }
< prev index next >