Pergunta

I have a main screen that hosts a StackPane. In this StackPane, any particular screen may be loaded and displayed at a time. The first screen, for example, is going to be a splash screen. Should I make the root container of the splash screen an AnchorPane or something? I want for my screen to be resized to fit its parent upon dynamically loading it into the top level StackPane. If the window with the StackPane gets resized, then the child screens resize along with it.

If this were Android the answer would be fit_to_parent, but unfortunately this is not it. :P

Desired

Actual

Foi útil?

Solução

It seems I have figured it out. The AnchorPane that my nodes are being dynamically added to need to have their constraints set dynamically. That is, AnchorPane.setTopAnchor(node, double) and so on.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top