I am using TornadoFX
in my project. I have a root View which is a borderPane
. I was able to find setPrefSize(1200.0, 720.0)
and it works perfectly. However, by default the window is resizable, which user can resize it without any limits. Is there any property or method to set minHeight
and minWidth
of a window so that when resized, it stops at those limits?
So far I have tried these but none of them seem to work:
override val root = borderPane {
minHeight = 400.0
minWidth = 600.0
setMinSize(600.0, 400,0)
setWindowMinSize(600, 400) // this throws NPE
addClass(loginScreen) // I even set properties in CSS
}
// StyleClass
loginScreen{
minWidth = 600.px
minHeight = 400.px
}
What is the proper way of setting minHeight
and minWidth
of a window in TornadoFX? And one more thing, how do I actually disable window resizing in TornadoFX, there is no property called isResizable
?
P.S. I am a super novice in Kotlin and in TornadoFX. Just started it today.