我是tornadoFX的新手,我不知道如何设置PrimaryStage或Scene属性,如场景高度或宽度或PrimaryStage模态.
请帮我.
UPDATE
我想设置场景高度和宽度,看看这个例子:
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"))
}
}