Skip to content

Instantly share code, notes, and snippets.

@bjonnh
Created February 5, 2019 17:49
Show Gist options
  • Save bjonnh/49f04f73cae9380ad52583317efa2059 to your computer and use it in GitHub Desktop.
Save bjonnh/49f04f73cae9380ad52583317efa2059 to your computer and use it in GitHub Desktop.
package net.nprod.mnwe
import javafx.scene.input.KeyCombination
import tornadofx.*
class MainView: View() {
override val root = tabpane {
tab("1") {
button("Click me") {
shortcut(KeyCombination.valueOf("F12"))
action {
println("I was clicked for 1")
}
}
}
tab("2") {
button("Click me") {
shortcut(KeyCombination.valueOf("F12"))
action {
println("I was clicked for 2")
}
}
}
}
}
class MyApp : App(
MainView::class)
fun main(args: Array<String>) {
launch<MyApp>(args)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment