title: How to fix exception when creating JFXPanel in Swing with JavaFX 12
body: <p>I have a large Java application with a Swing-based UI that uses JavaFX to render video panels and WebView panels in parts of some windows via JFXPanel components.</p>
  
  <p>Everything worked fine with JDK 8 but I am migrating to OpenJDK 12 and JavaFX 12 and am getting a runtime exception when creating a JFXPanel. When I call "new JFXPanel()" I am getting the exception:</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: class 
  javafx.embed.swing.JFXPanel (in unnamed module @0x44bebd15) cannot access 
  class com.sun.javafx.logging.PlatformLogger (in module javafx.base) because 
  module javafx.base does not export com.sun.javafx.logging to unnamed module 
  @0x44bebd15
  </code></pre>
  
  <p>The javafx.base and javafx.swing jar files from javafx-sdk-12.0.2 are included in my Eclipse project and runtime (along with a few other JavaFX jars).</p>
  
  <p>I am using VM arguments:
      --module-path /Library/Java/javafx-sdk-12.0.2/lib --add-modules javafx.controls,javafx.web,javafx.media,javafx.base</p>
  
  <p>Is this a bug in JavaFX 12 or am I doing something wrong?</p>
  
  <pre><code>htmlPanel = new JFXPanel() {
      public Dimension getPreferredSize() {                                              
      return new Dimension(CoreDrawer.scaledSize(width), 
      CoreDrawer.scaledSize(height));                             
          }
  
      public Dimension getMinimumSize() 
        {
      return getPreferredSize();                  
      }
    };
  
    Platform.runLater(new Runnable() {    //  run on the JavaFX thread                                                             
    public void run() {                                                                
    initFX(htmlPanel);                                                             
      }
    });
  
    Platform.setImplicitExit(false);
    thePanel.add(htmlPanel);
  </code></pre>
  
  <p>The function initFX() adds a Scene to the JFXPanel but the program does not get past "new JFXPanel()"</p>