JavaFX: Why does stage.setResizable(false) cause additional margins?
This small JavaFX test application
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class ApplicationWithNonResizableStage extends Application {
public static void main(final String[] args) {
launch(args);
}
@Override
public void start(final Stage primaryStage) throws Exception {
final Rectangle rectangle = new Rectangle(200, 100, Color.POWDERBLUE);
final BorderPane pane = new BorderPane(rectangle);
final Scene scene = new Scene(pane);
primaryStage.setScene(scene);
primaryStage.setResizable(false);
primaryStage.show();
}
}
produce a window with unwanted padding:
Removing the call also removes the effect:primaryStage.setResizable(false)
What is going wrong?