代码语言:txt复制
import tornadofx.*
class MainView13 : View("MainView") {
val data = (1..10).map {
"${it}_name${it}"
}.asObservable()
val persions=(1..10).map {
Person(it,"name${it}")
}.asObservable()
override val root = gridpane {
row {
tableview(persions) {
column("Id", String::class) {
value {
it.value.id
}
}
column("Name", String::class) {
value {
it.value.name
}
}
}
tableview(data) {
column("Id", String::class) {
value {
it.value.split("_").first()
}
}
column("Name", String::class) {
value {
it.value.split("_").last()
}
}
}
hgap = 20.0
}