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

IllegalAccessError in JFXPanel after fix for JDK-8080395

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • javafx

      To reproduce this, run any JFXPanel application with a recent JDK (e.g., jdk-9+117) such as HelloJFXPanel and click on the JFXPanel to give it focus.

      $ java HelloJFXPanel
      Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: failed to access class sun.awt.CausedFocusEvent from class javafx.embed.swing.JFXPanel
      at javafx.embed.swing.JFXPanel.sendFocusEventToFX(javafx.swing@9-internal/JFXPanel.java:595)
      at javafx.embed.swing.JFXPanel.processFocusEvent(javafx.swing@9-internal/JFXPanel.java:616)
      at java.awt.Component.processEvent(java.desktop@9-internal/Component.java:6357)
      at java.awt.Container.processEvent(java.desktop@9-internal/Container.java:2258)
      ...


      The fix for JDK-8080395 introduced new public API for getting the cause of a FocusEvent. It also made the existing import sun.awt.CausedFocusEvent class package-private. JFXPanel references this class, so we get the above error at run time when clicking on a JFXPanel to give it focus.

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: