import javafx.beans.property.StringProperty; import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.property.SimpleStringProperty; public class Mark { private StringProperty subject; private IntegerProperty mark; public Mark(String subject, Integer mark) { subjectProperty().set(subject); markProperty().set(mark); } public StringProperty subjectProperty() { if (this.subject == null) { this.subject = new SimpleStringProperty(this, "subject"); } return this.subject; } public IntegerProperty markProperty() { if (this.mark == null) { this.mark = new SimpleIntegerProperty(this, "mark"); } return this.mark; } public String getSubject() { return this.subjectProperty().get(); } public Integer getMark() { return this.markProperty().get(); } }