title: How to pass a Variable through JavaFX Application to the Controller?
body: <p>I'd like to ask if it is possible to pass a Variable through a JavaFX Class what extends Application to my JavaFx Controller? I am very new to JavaFx and only may need a little kick.</p>
  
  <p>The goal is to pass a Id from MyClass to MyController.</p>
  
  <p>My Application class:</p>
  
  <pre><code>public class MyClass extends Application {
      private String myVariable="Anything";
  
      public static void main(String[] args) {
          launch(args);
      }
  
      @Override
      public void start(Stage stage) throws Exception {
          URL location = getClass().getResource("MyGui.fxml");
  
          FXMLLoader fxmlLoader = new FXMLLoader();
          fxmlLoader.setLocation(location);
          fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
          Parent root = FXMLLoader.load(location);
          Scene scene = new Scene(root);
  
          stage.setTitle(title);
          stage.setScene(scene);
          stage.show();
      }
  }
  </code></pre>
  
  <p>My Controller:</p>
  
  <pre><code>public class Controller extends Group implements Binding {
  
  public void initialize(Map&lt;String, Object&gt; namespace, URL location, Resources resources) {
  
  // HERE I'D LIKE TO GET MY VARIABLE LIKE
  System.out.println(myVariable);
  }
  
  @Override
  public List&lt;Handler&gt; getHandlerChain() {
      return null;
  }
  
  @Override
  public void setHandlerChain(List&lt;Handler&gt; chain) {
  }
  
  @Override
  public String getBindingID() {
      return null;
  }
  }
  </code></pre>