To test this unexpected behavior, I just put it TextAreadirectly in Scene, contained in PrimaryStage: when the application starts, it TextAreaexactly matches the window (as expected).
But the size TextAreadoes not change if I move the borders of the window, which is the problem I'm trying to solve.
See my screenshot
This is my ScalaFX code (which I expect to act exactly like its JavaFX equivalent):
object MyApp extends JFXApp {
stage = new PrimaryStage {
title = "My App"
resizable = true
maxWidth = Double.MaxValue
maxHeight = Double.MaxValue
val outputDisplay = new TextArea {
resizable = true
maxWidth = Double.MaxValue
maxHeight = Double.MaxValue
hgrow = Priority.Always
vgrow = Priority.Always
}
scene = new Scene {
resizable = true
maxWidth = Double.MaxValue
maxHeight = Double.MaxValue
fill = LightGreen
content = outputDisplay
}
}
}
source
share