package org.example import javafx.application.Application import javafx.beans.property.* import tornadofx.* class Item(nullableBoolean: Boolean? = null, nullableString: String? = null) { var nullableString: String? by property(nullableString) val nullableStringProperty1: ObjectProperty = getProperty(Item::nullableString) val nullableStringProperty2: SimpleStringProperty = SimpleStringProperty(this, "nullableString") var nullableBoolean: Boolean? by property(nullableBoolean) val nullableBooleanProperty1: ObjectProperty = getProperty(Item::nullableBoolean) val nullableBooleanProperty2: SimpleBooleanProperty = SimpleBooleanProperty(this, "nullableBoolean") } class ItemModel : ItemViewModel(Item()) { val nullableStringProperty1: Property> = bind(Item::nullableStringProperty1) // instead of Property val nullableStringProperty2: Property = bind(Item::nullableStringProperty2) val nullableBooleanProperty1: Property> = bind(Item::nullableBooleanProperty1) // instead of Property val nullableBooleanProperty2: Property = bind(Item::nullableBooleanProperty2) } class TestView : ItemFragment() { private val model = ItemModel().bindTo(this) override val root = vbox { label(stringBinding(model.nullableStringProperty1) { val propertyValue: ObjectProperty? = value // nullableStringProperty1 = null "nullableStringProperty1 = ${propertyValue?.get()}" }) label(stringBinding(model.nullableStringProperty2) { val propertyValue: String? = value // nullableStringProperty2 = null "nullableStringProperty2 = $propertyValue" }) label(stringBinding(model.nullableBooleanProperty1) { val propertyValue: ObjectProperty? = value // nullableBooleanProperty1 = null "nullableBooleanProperty1 = ${propertyValue?.get()}" }) label(stringBinding(model.nullableBooleanProperty2) { val propertyValue: Boolean? = value // nullableBooleanProperty2 = false <--- "nullableBooleanProperty2 = $propertyValue" }) } } class MyApp : App(TestView::class)