ScalaFX (JavaFX): Stage content does not resize on window resize

Viewed 988

To inspect this unexpected behavior, I simply put a TextArea directly into the Scene contained by the PrimaryStage: On app start, the TextArea exactly fits the window (as expected).

But the size of the TextArea does not change if I move the window's borders, which is the problem I am trying to solve.

Please 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 // has no effect
    maxWidth = Double.MaxValue // has no effect
    maxHeight = Double.MaxValue // has no effect

    val outputDisplay = new TextArea {
      resizable = true // has no effect
      maxWidth = Double.MaxValue // has no effect
      maxHeight = Double.MaxValue // has no effect
      hgrow = Priority.Always // has no effect
      vgrow = Priority.Always // has no effect
    }

    scene = new Scene {
      resizable = true // has no effect
      maxWidth = Double.MaxValue // has no effect
      maxHeight = Double.MaxValue // has no effect
      fill = LightGreen

      // add outputDisplay as content
      content = outputDisplay
    }
  }
}
1 Answers
Related