title: Command line arguments in JavaFX
body: <p>So I have to draw N rectangles between the values min and max. I have the code working to draw the rectangles. However, I can't figure out how to give it the command-line arguments N, min and max.
  This is what I have</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.scene.layout.AnchorPane;
  import javafx.scene.Scene;
  import javafx.scene.paint.Color;
  import javafx.scene.shape.Rectangle;
  import javafx.stage.Stage;
  
  public class testRect extends Application {
  
  @Override
  public void start(Stage Stage) throws Exception {
  
      AnchorPane root = new AnchorPane();
      Scene scene = new Scene(root, 500, 500, Color.LIGHTGREY);
      Stage.setScene(scene);
  
      int N = Integer.parseInt(args[0]);
      int min = Integer.parseInt(args[1]);
      int max = Integer.parseInt(args[2]);
      int interval = ((max - min)/ (N-1));
      Rectangle r = null;
      while(min &lt; max + 1){
          for(int i = 0; i &lt; N; i++) {
              r = new Rectangle(100, 100, min, min);
              r.setFill(Color.TRANSPARENT);
              r.setStroke(Color.BLACK);
              root.getChildren().add(r);
              min = min + interval;
          }
      }
      scene.setRoot(root);
      Stage.show();
  }
  public static void main(String[] args) {
      launch(args);
  }
  
  }
  </code></pre>
  
  <p>it works when I directly give N, min and max values. But I'm not sure how to do it with the command line.</p>