class LifeCycleMainView : BaseView("MainView") { override val root = hbox { label(title) { style { fontWeight = FontWeight.BOLD } } button ("Second View") { action { // // loaded from file // with(app.config) { set("initialPosition", 0.2) set("prefWidth", 770.0) set("prefHeight", 440.0) } find().openWindow(StageStyle.DECORATED) } } } } class SecondaryView : BaseView("Hello Secondary View") { override val root = splitpane(Orientation.HORIZONTAL) { vbox { label("Left") } vbox { label("Right") } if( app.config.get("initialPosition") != null ) { dividers[0].position = app.config.get("initialPosition") as Double } if( app.config.get("prefWidth") != null ) { prefWidth = app.config.get("prefWidth") as Double } if( app.config.get("prefHeight") != null ) { prefHeight = app.config.get("prefHeight") as Double } } }