Nico Smeenk
01/27/2019, 9:08 AMuseCheckbox(false)
(for a readonly checkbox) you still can click the checkbox and get an exception (java.lang.RuntimeException: CheckBox.selected : A bound value cannot be set.
). I was not able to find the problem in the Issues - am I doing something wrong?
import javafx.beans.property.SimpleBooleanProperty
import javafx.collections.FXCollections
import javafx.collections.ObservableList
import tornadofx.*
class TestApp : App(TestView::class)
class TestView : View() {
val model: ObservableList<Model> = FXCollections.observableArrayList<Model>()
override val root = vbox {
tableview(model) {
column("check", Model::bool).useCheckbox(false)
}
}
init {
for (i in 1..3) {
model.add(Model().apply { bool.value = i > 1 })
}
}
}
class Model {
val bool = SimpleBooleanProperty()
}