在我的Swing应用程序中,我有一些用JavaFX实现的图表。迁移到Java 11(OpenJDK)之后,每次用户单击图表时,我都会成为这些异常:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError:
failed to access class sun.awt.CausedFocusEvent from class javafx.embed.swing.JFXPanel$6 (sun.awt.CausedFocusEvent is in module java.desktop of loader 'bootstrap'; javafx.embed.swing.JFXPanel$6 is in unnamed module of loader 'app') at javafx.embed.swing.JFXPanel$6.run(Unknown Source)
at javafx.embed.swing.JFXPanel$6.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.embed.swing.JFXPanel.sendFocusEventToFX(Unknown Source)
at javafx.embed.swing.JFXPanel.processFocusEvent(Unknown Source)
at java.desktop/java.awt.Component.processEvent(Component.java:6388)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1950)
at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1051)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:675)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
at java.desktop/java.awt.KeyboardFocusManager.dispatchAndCatchException(KeyboardFocusManager.java:2597)
at java.desktop/java.awt.KeyboardFocusManager.processCurrentLightweightRequests(KeyboardFocusManager.java:2693)
at java.desktop/java.awt.KeyboardFocusManager$4.run(KeyboardFocusManager.java:2800)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)