JavaFX Scene Builder: How to uncheck "Resize" option in Layout tab?


Question

I want to make my .fxml application to not be resizeable, but I am not able to uncheck "Resizeable" check box on any anchorPanes, the option is greyed out. The same thing happens even on a new, completely empty project.

enter image description here

Product Version
JavaFX Scene Builder 1.1

Build Information
Version: 1.1-b35, Changeset: 50e3d7cdf394
Date: 2013-08-27 10:45
1
11
2/22/2017 2:34:54 PM

For resize functionality,you need to have stage of main class. initial stage reference will use it for make it non -resizable.

Try this.

MainClass.java

public class MainClass extends Application {

public static Stage stage;
@Override
public void start(Stage stage) throws Exception {
        this.stage = stage; // initialize value of stage.
    Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.show();
}

SampleController

 MainClass.stage.setResizable(false);
16
1/10/2014 5:19:26 AM

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