matthjes
01/24/2020, 2:20 PMoverride val root = borderpane { ... }
, how can I set the focus to a specific widget inside this hierarchy? Currently I have a TreeView and a TextArea somewhere nested inside root
and when the application starts the TreeView always has the focus. However, I'd like to have the TextArea having the focus.Arthur
01/24/2020, 2:32 PMmatthjes
01/24/2020, 2:49 PMoverride val root = borderpane {
...
treeview<String>(null) {
...
}
textarea {
requestFocus()
...
}
}
But still the focus is captured by the TreeView.Arthur
01/24/2020, 7:46 PMclass MyView : View() {
private val myTextArea = TextArea()
override val root = borderpane {
center = treeview<String> {
}
left = myTextArea
}
override fun onDock() {
super.onDock()
myTextArea.requestFocus()
}
}
matthjes
01/25/2020, 7:22 AMArthur
01/25/2020, 8:04 AM