Why can't I set AnchorPane's resizable attribute?


Question

I created a FXML file using JavaFX Scene Builder 1.1. An AnchorPane is created by default. Why can't I modify the resizable attribute?

enter image description here

1
7
2/17/2017 4:03:24 PM

Accepted Answer

Why you can't edit bounds

Checkout the javadoc on layoutBounds and boundsInLocal. You will notice that both are ReadOnlyObjectProperties, which is why you can't directly modify them in SceneBuilder.

How to resize a node in SceneBuilder

You can indirectly effect the bounds properties and directly set the resizable properties of the node by altering the min, pref and max height and width.

SIZING

You can also set the pref size by selecting the pane to be resized and dragging the resizing anchors the surround the selected pane.

Further Information

You might want to read the Oracle tutorial on Tips for Sizing Nodes and Amy Fowler's presentation on JavaFX layout.

4
2/21/2014 8:21:42 PM

Do you want to disable window resizing? If so, you can do that in your application program:

stage.setResizable(false);

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon