RosettaCodeData/Task/Simple-windowed-application/JavaFX-Script/simple-windowed-application.javafx
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

25 lines
591 B
Text

import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.layout.*;
import javafx.scene.control.*;
Stage {
scene: Scene {
width: 300 height: 200
content: VBox {
var clicks: Integer;
spacing: 10
content: [
Label {
def varText = bind if (clicks == 0) then "no clicks yet" else "{clicks} clicks"
text : bind "There have been {varText}"
}
Button {
text: "click me"
onMouseClicked: function(e) { clicks++; }
}
]
}
}
}