title: JavaFX run from constructor.
body: <p>I would like to use this class in order to run a media file using only the constructor , without a main method. 
  (Im running this Player class from a GUI) how can i use luanch() without a main method? </p>
  
  <pre><code>public class Player extends Application {
      File file = null; // a file to play. 
  
      public Player (File file){
          this.file = file;
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  
      @Override
      public void start(Stage primaryStage) throws MalformedURLException {
          URL               url  = file.getAbsoluteFile().toURI().toURL(); // URL path of the file.
          final Media       m    = new Media(url.toString());
          final MediaPlayer mp   = new MediaPlayer(m);
          final MediaView   mv   = new MediaView(mp);
  
          final DoubleProperty width  = mv.fitWidthProperty();
          final DoubleProperty height = mv.fitHeightProperty();
  
          width.bind(Bindings.selectDouble(mv.sceneProperty(), "width"));
          height.bind(Bindings.selectDouble(mv.sceneProperty(), "height"));
  
          mv.setPreserveRatio(true);
  
          StackPane root = new StackPane();
          root.getChildren().add(mv);
  
          final Scene scene = new Scene(root, 960, 540);
          scene.setFill(Color.BLACK);
  
          primaryStage.setScene(scene);
          primaryStage.show();
  
          mp.play();
    }
  }
  </code></pre>