title: Different layout between Scene builder preview and program in execution
body: <p>When I execute my program, the interface is different from the scene builder preview. This problem is driving me crazy. What can i do to solve this problem?
  <a href="http://i.stack.imgur.com/M5nM1.jpg" rel="nofollow">Preview vs Result in execution</a>
  FXML</p>
  
  <pre><code>            &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
          &lt;?import java.lang.*?&gt;
          &lt;?import java.net.*?&gt;
          &lt;?import javafx.scene.control.*?&gt;
          &lt;?import javafx.scene.layout.*?&gt;
          &lt;?import javafx.scene.layout.AnchorPane?&gt;
          &lt;?import javafx.scene.paint.*?&gt;
          &lt;?import javafx.scene.text.*?&gt;
  
          &lt;AnchorPane prefHeight="425.0" prefWidth="242.0" styleClass="background" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="application.FirstController"&gt;
            &lt;children&gt;
              &lt;Hyperlink layoutX="53.0" layoutY="357.0" text="Password dimenticata?" textFill="#33e7ff"&gt;
                &lt;stylesheets&gt;
                  &lt;URL value="@application.css" /&gt;
                &lt;/stylesheets&gt;
              &lt;/Hyperlink&gt;
              &lt;TextField fx:id="txtUsername" layoutX="15.0" layoutY="231.0" prefWidth="207.0" promptText="Username" /&gt;
              &lt;Separator layoutX="13.0" layoutY="345.0" prefHeight="4.0" prefWidth="200.0" /&gt;
              &lt;Separator layoutX="16.0" layoutY="220.0" prefWidth="200.0" /&gt;
              &lt;Button id="btnConferma" layoutX="14.0" layoutY="301.0" mnemonicParsing="false" prefWidth="99.0" text="Conferma" /&gt;
              &lt;Button id="btnAnnulla" layoutX="123.0" layoutY="301.0" mnemonicParsing="false" prefWidth="99.0" text="Annulla" /&gt;
              &lt;Text layoutX="92.0" layoutY="79.0" scaleX="3.5060922995036727" scaleY="2.63215859030837" strokeType="OUTSIDE" strokeWidth="0.0" text="CARLOAN"&gt;
                &lt;fill&gt;
                  &lt;Color blue="1.000" green="0.522" red="0.200" fx:id="x1" /&gt;
                &lt;/fill&gt;
              &lt;/Text&gt;
              &lt;Text fill="$x1" layoutX="189.0" layoutY="110.0" scaleX="1.3491931995059285" scaleY="1.313264806656877" strokeType="OUTSIDE" strokeWidth="0.0" text="V1.0" /&gt;
              &lt;TextArea id="areaTesto" editable="false" layoutX="19.0" layoutY="146.0" prefHeight="67.0" prefWidth="200.0" style="&amp;#10;" text="Benvenuto in CarLoan! Per favore effettua il login per utilizzare tutte le funzionalità del sistema." wrapText="true"&gt;
                &lt;stylesheets&gt;
                  &lt;URL value="@application.css" /&gt;
                &lt;/stylesheets&gt;
              &lt;/TextArea&gt;
              &lt;PasswordField fx:id="txtPassword" layoutX="15.0" layoutY="270.0" prefWidth="207.0" promptText="Password" /&gt;
            &lt;/children&gt;
            &lt;stylesheets&gt;
              &lt;URL value="@application.css" /&gt;
            &lt;/stylesheets&gt;
          &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>This is the css: <a href="http://pastebin.com/NWTT8DAa" rel="nofollow">http://pastebin.com/NWTT8DAa</a> </p>
  
  <p>I'm using a lot of Pattern for this Project. In particular, I have a front controller in main class of package and a dispatcher where is executed the view exchange. I'm posting the main classe and the method that change the view:</p>
  
  <p>MAIN CLASS:</p>
  
  <pre><code>        package application;
  
  import Eccezioni.Eccezione;
  import presentation.tier.FrontController;
  import javafx.application.Application;
  import javafx.stage.Stage;
  
  public class Main extends Application {
  
      public static final Stage stage = new Stage();
  
      @Override
      public void start(Stage primaryStage) throws Eccezione {
          try {
              FrontController fc = null;
              fc = FrontController.getInstance();
              fc.handleRequest("openViewStart", null);
          } catch (Exception e) {
              throw new Eccezione("Impossibile lanciare il programma..");
          }
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p>And this is the DISPATCHING METHOD:</p>
  
  <pre><code>        private void apriViewStart() throws Eccezione {
          try {
              AnchorPane root = (AnchorPane) FXMLLoader.load(getClass().getResource("/application/Login.fxml"));
              Scene scene = new Scene(root);
              scene.getStylesheets().add(getClass().getResource("/application/application.css").toExternalForm());
              Main.stage.setTitle("CarLoan 1.0");
              Main.stage.setScene(scene);
              Main.stage.show();
  
          } catch (Exception e) {
              throw new Eccezione("Impossibile caricare l'interfaccia.");
          }
  
      }
  </code></pre>