Simple windowed application: Difference between revisions

m
Line 1,274:
 
{{libheader|TornadoFX}}
<lang scala>import javafx.application.Application
import tornadofx.*
 
class ClicksView: View("Clicks example") {
 
var clicks = 0
override val root = vbox(5) {
 
var label1 = label("There have been no clicks yet")
override val root = vbox {
button("Click me!") { action var{ label1.text = label("There have been noClicked ${++clicks} yettimes.") } }
}
button("Click me!") { action { label1.text = "Clicked ${++clicks} times." } }
}
}
 
class ClicksApp: App(ClicksView::class)
 
fun main(args: Array<String>) {= launch<ClicksApp>(args)
}</lang>
Application.launch(ClicksApp::class.java)
}</lang>
 
=={{header|Lambdatalk}}==
Anonymous user