Skip to content

Instantly share code, notes, and snippets.

@nickthecoder
nickthecoder / FocusNext.kt
Last active July 10, 2019 15:07
JavaFX : Move keyboard focus to the next Node. (Written in Kotlin)
package uk.co.nickthecoder.tedi
import javafx.scene.Node
import javafx.scene.Parent
/**
* JavaFX 8 does not expose an API to navigate focus. This is a "bodge" to get around the problem.
* Attempts to request focus on the next node.
*
* Note, the ordering is based on order of the children within [Parent] nodes, and may not be the