title: How to pass parameters to JavaFX application?
body: <p>I am running my JavaFX application like this:</p>
  
  <pre><code>public class MainEntry {
      public static void main(String[] args) {
          Controller controller = new Controller();
          Application.launch(MainStage.class);
      }
  }
  </code></pre>
  
  <p><code>MainStage</code> class extends <code>Appication</code>. <code>Application.launch</code> starts my JavaFX window in a special FX-thread, but in my main method I don't even have an instance of my <code>MainStage</code> class.</p>
  
  <p>How to pass non-String parameter (<em>controller</em> in my case) to <code>MainStage</code> instance? Is it a flawed design?</p>