Hi,
when executing the class Person.kt from the guide:
package de.auticon.maven.tornadofx
import javafx.beans.property.SimpleIntegerProperty
import javafx.beans.property.SimpleObjectProperty
import javafx.beans.property.SimpleStringProperty
import java.time.LocalDate
import java.time.Period
class Person(id: Int, name: String, birthday: LocalDate) {
val idProperty = SimpleIntegerProperty(id)
var id by idProperty
val nameProperty = SimpleStringProperty(name)
var name by nameProperty
val birthdayProperty = SimpleObjectProperty(birthday)
var birthday by birthdayProperty
val age: Int get() = Period.between(birthday, LocalDate.now()).years
}
I get the errors:
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.3.0-rc-198:compile (compile) on project de-auticon-maven-tornadofx: Compilation failure: Compilation failure:
[ERROR]
C:\Users\Lap127\IdeaProjects\deauticonmaventornadofx\src\main\kotlin\deauticon\maventornadofx\Person.kt:[11,15] Property delegate must have a 'getValue(Person, KProperty<*>)' method. None of the following functions is suitable:
[ERROR] public open fun getValue(): Int! defined in javafx.beans.property.SimpleIntegerProperty
.
.
.
Process finished with exit code 1
You need to import tornadofx.* :)
ty
You're welcome :) I've updated the guide to include the import.
BTW issue #677 is not resolved in the guide yet...
Done. There are too many readonlyColumn examples in the guide to my liking, I'd like to make most of them based on observable properties, since that's the best practice.
Most helpful comment
You need to
import tornadofx.*:)