1// This file was automatically generated from ${file.name} by Knit tool. Do not edit. 2package ${knit.package}.${knit.name} 3 4import kotlinx.coroutines.* 5import kotlinx.coroutines.channels.* 6import kotlinx.coroutines.javafx.JavaFx as Main 7import javafx.application.Application 8import javafx.event.EventHandler 9import javafx.geometry.* 10import javafx.scene.* 11import javafx.scene.input.MouseEvent 12import javafx.scene.layout.StackPane 13import javafx.scene.paint.Color 14import javafx.scene.shape.Circle 15import javafx.scene.text.Text 16import javafx.stage.Stage 17 18fun main(args: Array<String>) { 19 Application.launch(ExampleApp::class.java, *args) 20} 21 22class ExampleApp : Application() { 23 val hello = Text("Hello World!").apply { 24 fill = Color.valueOf("#C0C0C0") 25 } 26 27 val fab = Circle(20.0, Color.valueOf("#FF4081")) 28 29 val root = StackPane().apply { 30 children += hello 31 children += fab 32 StackPane.setAlignment(hello, Pos.CENTER) 33 StackPane.setAlignment(fab, Pos.BOTTOM_RIGHT) 34 StackPane.setMargin(fab, Insets(15.0)) 35 } 36 37 val scene = Scene(root, 240.0, 380.0).apply { 38 fill = Color.valueOf("#303030") 39 } 40 41 override fun start(stage: Stage) { 42 stage.title = "Example" 43 stage.scene = scene 44 stage.show() 45 setup(hello, fab) 46 } 47}