title: AutoCompletionBinding cannot access class com.sun.javafx.event.EventHandlerManager
body: <p>I have some issues with <code>javafx</code> and <code>org.controlsfx.control.textfield.TextFields</code>. I'm trying to implement a feature that would get possible user input predictions from a database so that user can only pick the "authorized" options. While working with <code>controlsfx</code> I came across this error. </p>
  
  <p>Error:</p>
  
  <pre><code>Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessError: class org.controlsfx.control.textfield.AutoCompletionBinding (in unnamed module @0x239a4ba) cannot access class com.sun.javafx.event.EventHandlerManager (in module javafx.base) because module javafx.base does not export com.sun.javafx.event to unnamed module @0x239a4ba
  at org.controlsfx.control.textfield.AutoCompletionBinding.&lt;init&gt;(AutoCompletionBinding.java:521)
  at impl.org.controlsfx.autocompletion.AutoCompletionTextFieldBinding.&lt;init&gt;(AutoCompletionTextFieldBinding.java:107)
  at impl.org.controlsfx.autocompletion.AutoCompletionTextFieldBinding.&lt;init&gt;(AutoCompletionTextFieldBinding.java:92)
  at org.controlsfx.control.textfield.TextFields.bindAutoCompletion(TextFields.java:187)
  at sample.Controller.lambda$listenKey$0(Controller.java:40)
  at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
  at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
  at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
  at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
  at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
  at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
  at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
  at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
  at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
  at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
  at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
  at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
  at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
  at javafx.graphics/javafx.scene.Scene$KeyHandler.process(Scene.java:4058)
  at javafx.graphics/javafx.scene.Scene$KeyHandler.access$1500(Scene.java:4004)
  at javafx.graphics/javafx.scene.Scene.processKeyEvent(Scene.java:2121)
  at javafx.graphics/javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2595)
  at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:217)
  at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:149)
  at java.base/java.security.AccessController.doPrivileged(Native Method)
  at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(GlassViewEventHandler.java:248)
  at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:390)
  at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:247)
  at javafx.graphics/com.sun.glass.ui.View.handleKeyEvent(View.java:547)
  at javafx.graphics/com.sun.glass.ui.View.notifyKey(View.java:971)
  at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
  at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
  at java.base/java.lang.Thread.run(Thread.java:834)
  </code></pre>
  
  <p>I've learnt that, quote <code>Since Java Web Start is no longer a part of Java SE 11 and later, we will not look into this.</code>. I don't know if it's because of that or I'm doing something wrong.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>    package sample;
  /**
   * Sample Skeleton for 'sample.fxml' Controller Class
   */
  
  import java.net.URL;
  import java.util.*;
  
  import javafx.fxml.FXML;
  import javafx.scene.control.TextField;
  import org.controlsfx.control.textfield.TextFields;
  
  public class Controller{
  
      @FXML // ResourceBundle that was given to the FXMLLoader
      private ResourceBundle resources;
  
      @FXML // URL location of the FXML file that was given to the FXMLLoader
      private URL location;
  
      // fx:id="inputAutoComplete";
      @FXML
      private TextField inputAutoComplete;
  
      @FXML // This method is called by the FXMLLoader when initialization is complete
      void initialize() {
          System.out.println("XD");
          listenKey();
      }
  
      ArrayList&lt;String&gt; possibleWordSet = new ArrayList&lt;&gt;();
  
      public void listenKey(){
          databaseConnection dbconn = new databaseConnection();
          inputAutoComplete.setOnKeyPressed((event) -&gt; {
              if(inputAutoComplete.getText().length() &gt; 4){
                  System.out.println(inputAutoComplete.getText());
                  possibleWordSet = dbconn.getSuggestedData(inputAutoComplete.getText());
                  System.out.println(possibleWordSet);
                  TextFields.bindAutoCompletion(inputAutoComplete,possibleWordSet);
              }
          });
      }
  }
  </code></pre>
  
  <p>Can someone give me some examples of how to implement this feature or just tell what am I doing wrong?</p>