fx:controller="app.MainController"
override val root : TextArea by fxml("/view/MainView.fxml")
val msg : Label by fxid()
fun hello() {
msg.text="you click the hello button"
}
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<BorderPane fx:id="mainWindow" prefHeight="600.0" prefWidth="900.0"
xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<center>
<VBox spacing="20">
<children>
<Label fx:id="msg">
</Label>
<Button fx:id="mybtn" onAction="#hello" text="hello tornadofx">
</Button>
</children>
</VBox>
</center>
</BorderPane>
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。