I have the current situation: the main windows with the main BorderPane . In the center of it is AnchorPane with some objects inside. I want to distribute objects equally inside the height of the panel, even if the size of the area changes.
The problem I am facing is that all things work when resizing increases the height of the panel. When I reduce the size of the window, the height of the panel continues to grow.
I reproduced the error in this example application using a simple line (in my application I also have a line):
import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.BorderPane; import javafx.scene.layout.Pane; import javafx.scene.shape.Line; import javafx.stage.Stage; public class ResizeProblem extends Application { @Override public void start(Stage primaryStage) { BorderPane root = new BorderPane(); AnchorPane inner = new AnchorPane(); Line line = new Line();
I saw that, avoiding nesting, everything worked as expected.
What is wrong with that?
Please help me find the right direction.
iluke source share