我和我的朋友正在研究一个JavaFX应用程序,它可以作为我们学校的规划者.我们有任务(课堂作业),活动,课程和学生信息.为了将数据持久存储在用户的硬盘上,我们使用的是JAXB.
我们已经注释了我们的类,并且可以在包装器中成功编组Task类.问题是从tasks.xml文件中解组.
@XmlRootElement
public class Task {
//constructors
//complete constructor
public Task(String className, String assignment, String description, LocalDate dueDate) {
this.className = new SimpleStringProperty(className);
this.assignment = new SimpleStringProperty(assignment);
this.description = new SimpleStringProperty(description);
this.dueDate = new SimpleObjectProperty<LocalDate>(dueDate);
}
/**
* Sets a model data into the task, sets the
* due date to be tomorrow.
*/
public Task() {
this("", "", "", LocalDate.now().plusDays(1));
setClassName("English");
setAssignment("Read");
setDescription("1984");
//setDueDate(LocalDate.now());
}
//Instance variables
private final SimpleStringProperty className;
private final …Run Code Online (Sandbox Code Playgroud)