Skip to content

Instantly share code, notes, and snippets.

@bjonnh
Created December 19, 2018 22:46
Show Gist options
  • Save bjonnh/96c52620f46edad5d254498724a77fec to your computer and use it in GitHub Desktop.
Save bjonnh/96c52620f46edad5d254498724a77fec to your computer and use it in GitHub Desktop.
import javafx.geometry.Orientation
import javafx.scene.Scene
import javafx.scene.control.TextField
import javafx.scene.image.Image
import javafx.scene.layout.BorderPane
import javafx.scene.layout.HBox
import javafx.scene.layout.VBox
import javafx.stage.Stage
import tornadofx.*
class MyApp : App(MyView::class) {
override fun start(stage: Stage) {
super.start(stage)
stage.minWidth = 800.0
stage.minHeight = 600.0
}
}
class StatsView : View() {
var firstNameField: TextField by singleAssign()
override val root = hbox {
label("First Name")
firstNameField = textfield()
}
}
class MyView : View() {
override val root = BorderPane()
var statsView: StatsView by singleAssign()
init {
title = "Spinverter"
with(root) {
top = hbox {
imageview {
image = Image(resources["/logo.png"])
}
label {
text = "Spinverter"
style {
fontSize = 6.em
}
}
}
center = hbox {
button { text="Load PMS File"}
statsView = StatsView()
}
}
}
}
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