title: JavaFX: Why does stage.setResizable(false) cause additional margins?
body: <p>This small JavaFX test application</p>
  
  <pre><code>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();
      }
  }
  </code></pre>
  
  <p>produce a window with unwanted padding:</p>
  
  <p><img src="https://i.stack.imgur.com/T2kSl.png" alt="stage with margin"></p>
  
  <p>Removing the call <code>primaryStage.setResizable(false)</code> also removes the effect:</p>
  
  <p><img src="https://i.stack.imgur.com/rf6qS.png" alt="stage without margin"></p>
  
  <p>What is going wrong?</p>