I have a Object bounds controls.
public class Record {
private final SimpleStringProperty uid = new SimpleStringProperty();
private final SimpleStringProperty name = new SimpleStringProperty();
private final SimpleStringProperty person = new SimpleStringProperty();
//getters and setters
Then, i use com.google.gson to deserialize: new Gson().fromJson(lineStr, Record.class);
It takes a reflect exception:Unable to make field private final java.lang.Object javafx.beans.property.SimpleStringProperty.bean accessible: module javafx.base does not "opens javafx.beans.property" to module com.google.gson
In module-info.java:
module myModule {
requires javafx.controls;
requires javafx.fxml;
requires javafx.base;
requires org.controlsfx.controls;
opens myModule to javafx.fxml,com.google.gson;
exports ......
}
I tried to add opens javafx.beans.property to com.google.gson;
, the IDE shows Package not found: javafx.beans.property
.
I don't know much about javafx.beans module's dependency relations.I guess the correct solution is to open the javafx.beans.property to gson.Who can help me :) ?