TornadoFX Disable Window Resize


#1

Hello Community,

i’m playing with the examples from https://github.com/edvin/tornadofx-samples/t. I’m totally new to kotlin and i don’t understand the property concept in interfaces. I believe this concept is used, when i want to set the isResizeable attribut to false. How do i disable the main window resize option?

package no.tornadofx.fxsamples.tableviews

import javafx.collections.FXCollections
import javafx.scene.layout.GridPane
import tornadofx.*

class DemoTableView : View() {
    override val root = GridPane()

    val mapTableContent = mapOf(Pair("item 1", 5), Pair("item 2", 10), Pair("item 3", 6), Pair("item 4", 11))

    init {
        title = "Mein Fenster"
        with(root)
        {
            isResizable = false
            prefWidth = 1024.0
            prefHeight = 800.0

            row {
                vbox {
                    label("Tableview from a map")

                }
            }
        }
    }
}

#2

Okay, it seems that i was in the wrong spot ready for action. After studying another example i realized that i can disable the window resize if i change the main file.

package no.tornadofx.fxsamples.tableviews

import javafx.application.Application
import javafx.scene.Scene
import javafx.stage.Stage
import tornadofx.App
import tornadofx.FX
import tornadofx.UIComponent
import tornadofx.importStylesheet

class TableViewApp : App(DemoTableView::class) {
    override fun start(stage: Stage) {
        stage.isResizable = false
        super.start(stage)
    }
}



fun main(args: Array<String>) {

    Application.launch(TableViewApp::class.java, *args)

}