< prev index next >

modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/SwingFXUtilsImpl.java

Print this page

        

@@ -31,12 +31,11 @@
 import java.awt.SecondaryLoop;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.concurrent.atomic.AtomicBoolean;
 import javafx.application.Platform;
-import sun.awt.AWTAccessor;
-import sun.awt.FwDispatcher;
+import jdk.swing.interop.DispatcherWrapper;
 
 public class SwingFXUtilsImpl {
 
     private static class FwSecondaryLoop implements SecondaryLoop {
 

@@ -63,11 +62,11 @@
             }
             return false;
         }
     }
 
-    private static class FXDispatcher implements FwDispatcher {
+    private static class FXDispatcher extends DispatcherWrapper {
 
         @Override
         public boolean isDispatchThread() {
             return Platform.isFxApplicationThread();
         }

@@ -88,13 +87,13 @@
                 (PrivilegedAction<EventQueue>) () -> java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue());
     }
 
     //Called with reflection from PlatformImpl to avoid dependency
     public static void installFwEventQueue() {
-        AWTAccessor.getEventQueueAccessor().setFwDispatcher(getEventQueue(), new FXDispatcher());
+        DispatcherWrapper.setFwDispatcher(getEventQueue(), new FXDispatcher());
     }
 
     //Called with reflection from PlatformImpl to avoid dependency
     public static void removeFwEventQueue() {
-        AWTAccessor.getEventQueueAccessor().setFwDispatcher(getEventQueue(), null);
+        DispatcherWrapper.setFwDispatcher(getEventQueue(), null);
     }
 }
< prev index next >