This is my code which is causing the error.
ValidationSupport validationSupport = new ValidationSupport();
validationSupport.registerValidator(prefixCombo, Validator.createEmptyValidator("Combobox selection required!"));
This is the error I got when running the project.
Exception in thread "JavaFX Application Thread" java.lang.reflect.InaccessibleObjectException: Unable to make protected javafx.collections.ObservableList javafx.scene.Parent.getChildren() accessible: module javafx.graphics does not "opens javafx.scene" to module org.controlsfx.controls
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
This is my current module-info.java file
module system {
requires javafx.controls;
requires javafx.fxml;
requires jakarta.persistence;
requires org.hibernate.orm.core;
requires MaterialFX;
requires org.slf4j;
requires de.jensd.fx.glyphs.fontawesome;
requires static lombok;
requires org.controlsfx.controls;
requires javafx.graphics;
opens com.example.system to javafx.fxml, org.controlsfx.controls;
exports com.example.system;
exports com.example.system.controller;
opens com.example.system.controller to javafx.fxml, javafx.graphics;
opens com.example.system.entity to org.hibernate.orm.core;
opens com.example.system.tm to javafx.base;
}
I tried adding opens javafx.scene to org.controlsfx.controls; to module-infor.java.
Then, resulted in another error Package not found: javafx.scene
Thank you all in advance!!
0 comments:
Post a Comment
Thanks