I am getting an IllegalAccessError
class org.controlsfx.control.textfield.AutoCompletionBinding (in module org.controlsfx.controls) cannot access class com.sun.javafx.event.EventHandlerManager (in module javafx.base) because module javafx.base does not export com.sun.javafx.event to module org.controlsfx.controls
when using ControlsFX AutoCompletionBinding with
try {
SearchSession searchSession = Search.session(JpaUtil.getEntityManager());
SearchResult<Student> result = searchSession.search(Student.class)
.where(f -> f.match()
.field("firstName")
.matching(search))
.fetch(20);
List<Student> list = result.hits();
TextFields.bindAutoCompletion(searchField, list);
} catch (Exception ex) {
ex.printStackTrace();
}
I am trying to implement an autosuggestion search field (searching in the DB as you type). I am using JDK17. It is related to the modularity of Java but how can I fix that? Thanks.
Add the following plugin to your pom.xml file to configure the JavaFX runtime: