title: Primary stage changes scene size
body: <p>I have designed a simple scene with a few buttons in scene builder. Nothing special on that:</p>
  <p><a href="https://i.stack.imgur.com/YQzng.jpg" rel="nofollow noreferrer" title="Scene Builder"><img src="https://i.stack.imgur.com/YQzng.jpg" alt="scenebuilder" title="Scene Builder" /></a></p>
  <p>I've put that on the primary stage and it looks ok to me:</p>
  <p><a href="https://i.stack.imgur.com/vcb9J.jpg" rel="nofollow noreferrer" title="Resizable"><img src="https://i.stack.imgur.com/vcb9J.jpg" alt="resizable" title="Resizable" /></a></p>
  <p>But now, if i change the resizable attribute of the primary stage to false, the scene is growing on the right and on the bottom:</p>
  <p><a href="https://i.stack.imgur.com/PUHCA.jpg" rel="nofollow noreferrer" title="Not Resizable"><img src="https://i.stack.imgur.com/PUHCA.jpg" alt="resizable" title="Not Resizable" /></a></p>
  <p>Why is the scene growing on the right and bottom? In my oppionion there is nothing special on it:</p>
  <pre><code>@Override
  public void start(Stage stage) throws Exception {
      AnchorPane root = FXMLLoader.load(getClass().getResource(&quot;/fxml/start.fxml&quot;));
      Scene scene = new Scene(root);
      stage.setResizable(false);
      stage.setTitle(&quot;Game&quot;);
      stage.setScene(scene);
      stage.centerOnScreen();
      stage.show();       
  
  }
  </code></pre>
  <p>The FXML:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  
  &lt;?import java.lang.*?&gt;
  &lt;?import java.net.*?&gt;
  &lt;?import java.util.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.scene.paint.*?&gt;
  
  &lt;AnchorPane fx:id=&quot;rootPane&quot; maxHeight=&quot;-Infinity&quot; maxWidth=&quot;-Infinity&quot; minHeight=&quot;-Infinity&quot; minWidth=&quot;-Infinity&quot; prefHeight=&quot;310.0&quot; prefWidth=&quot;320.0&quot; xmlns:fx=&quot;http://javafx.com/fxml&quot; fx:controller=&quot;bla.bla.bla.Controller&quot;&gt;
    &lt;children&gt;
      &lt;Button fx:id=&quot;btnNewGame&quot; layoutX=&quot;10.0&quot; layoutY=&quot;10.0&quot; mnemonicParsing=&quot;false&quot; prefHeight=&quot;50.0&quot; prefWidth=&quot;300.0&quot; text=&quot;New Game&quot; /&gt;
      &lt;Button fx:id=&quot;btnLoadGame&quot; layoutX=&quot;10.0&quot; layoutY=&quot;70.0&quot; mnemonicParsing=&quot;false&quot; prefHeight=&quot;50.0&quot; prefWidth=&quot;300.0&quot; text=&quot;Load Game&quot; /&gt;
      &lt;Button fx:id=&quot;btnEditor&quot; layoutX=&quot;10.0&quot; layoutY=&quot;130.0&quot; mnemonicParsing=&quot;false&quot; prefHeight=&quot;50.0&quot; prefWidth=&quot;300.0&quot; text=&quot;Editor&quot; /&gt;
      &lt;Button fx:id=&quot;btnProperties&quot; layoutX=&quot;10.0&quot; layoutY=&quot;190.0&quot; mnemonicParsing=&quot;false&quot; prefHeight=&quot;50.0&quot; prefWidth=&quot;300.0&quot; text=&quot;Properties&quot; /&gt;
      &lt;Button fx:id=&quot;btnExit&quot; layoutX=&quot;10.0&quot; layoutY=&quot;250.0&quot; mnemonicParsing=&quot;false&quot; prefHeight=&quot;50.0&quot; prefWidth=&quot;300.0&quot; text=&quot;Exit&quot; /&gt;
    &lt;/children&gt;
    &lt;stylesheets&gt;
      &lt;URL value=&quot;@start.css&quot; /&gt;
    &lt;/stylesheets&gt;
  &lt;/AnchorPane&gt;
  </code></pre>
  <p>And the css:</p>
  <pre><code>#rootPane{
  -fx-background-color: #333333;
  }
  
  .button{
  -fx-background-color: #555555;
  -fx-text-fill: silver;
  -fx-background-radius: 0;
  -fx-border-radius: 0;
  -fx-border-color: #444444;   
  }
  </code></pre>
  <p>Thanks in advance!</p>