https://kotlinlang.org logo
Title
v

ValV

09/09/2018, 3:54 AM
@hudsonb Yes, that did the trick, thanks. This solved the problem (for initial example in Java):
import tornadofx.*
class MyClass {
  var myObservableProperty = SimpleStringProperty()
  var myObservable by myObservableProperty
}
and
val myClass = MyClass()
val property = myClass.myObservableProperty
myClass.myObservable = "New data"
println(myClass.myObservable)
Yeah, I love Kotlin 😃
b

bdawg.io

09/09/2018, 2:33 PM
If you don't need a direct reference to the
SimpleStringProperty
, you can just initialize it as the delegate directly
class MyClass {
   var myObservable by SimpleStringProperty()
}
v

ValV

09/09/2018, 4:32 PM
Good to know, i.e. here I'm getting observable property in one line. But I was using reference to
SimpleStringProperty
to set up observer via
setCellValueFactory