I have a JavaFX program written with Netbeans and Scene Builder. I am able to parse the command line arguments is either the main or start procedure. Based on the argument, I want to execute a procedure and display the results on the form.
This is probably pretty basic, but once I have the startup data, how do I start a procedure in the controller?
How do I pass inpArg to the controller code below. I am getting test data in inpArg.
public void start(Stage stage) throws Exception {
String inpArg;
Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
Parameters parameters = getParameters();
Map<String, String> namedParameters = parameters.getNamed();
inpArg = "";
System.out.println("\nnamedParameters -");
for (Map.Entry<String,String> entry : namedParameters.entrySet()) {
System.out.println(entry.getKey() + " : " + entry.getValue());
inpArg += entry.getValue();
}
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
// Controller code ---------------------
public void SetCmdLine(String cmdLine) {
lb_cmd_line.setText(cmdLine);
}