我是TornadoFX的新手,我不知道如何设置PrimaryStage或场景属性,如场景高度、宽度或PrimaryStage模态. 请帮帮我.
使现代化
I want to set Scene height and width, Look at this example:
dependencies {
compile 'no.tornado:tornadofx:1.5.2'
compile "org.jetbrains.kotlin:kotlin-stdlib:1.0.3"
}
import javafx.scene.control.Label
import javafx.scene.layout.VBox
import tornadofx.App
import tornadofx.FX
import tornadofx.View
class Main : App() {
override val primaryView = MyView::class
init {
// this two lines have error ( Val cannot be reassigned. )
FX.primaryStage.scene.height = 600.0
FX.primaryStage.scene.width = 800.0
// or this line causes this exception ( java.lang.NoSuchMethodException )
FX.primaryStage.isResizable = false
}
}
class MyView : View() {
override val root = VBox()
init {
root.children.add(Label("My label"))
}
}