8

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

3 Answers 3

17

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

stage.setResizable(false);
0
4

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.

1
  • I think Scene Builder could do a better job in indicating that it's a read-only property and cannot be set otherwise. Maybe they should just conceal the field, or put a hint bubble on there saying "This can only be modified via code, not here." Or better yet, allow the designer to uncheck the box and place the stage.setResizable(false); in the start() method. Commented Jul 17, 2019 at 1:40
0

You can change resizeble using code

primaryStage.setResizable(false);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.