case 1 = java standard types - transmit them as java Strings "--name=value" and then convert them to the final destination using the answer of dmolony
for ( Map.Entry<String, String> entry : namedParameters.entrySet ()){
System.out.println (entry.getKey() + " : " + entry.getValue ());
switch( entry.getKey()){
case "media_url": media_url_received = entry.getValue(); break;
}
}
The parameter is created at Application.launch and decoded at init
String args[] = {"--media_url=" + media_url, "--master_level=" + master_level};
Application.launch( args);
case 2 = If you have to transmit java objects use this workaround (this is for only one javafx Application launch, create a Map of workarounds and send index as strings if you have a complex case)
public static Transfer_param javafx_tp;
and in your class init set the instance of object to a static inside it's own class
Transfer_param.javafx_tp = tp1;
now you can statically find your last object for working with only one JavaFx Applications (remember that if you have a lot of JavaFx applications active you should send a String with a static variable identification inside a Map or array so you do not take a fake object address from your static structures (use the example at case 1 of this answer to transmit --javafx_id=3 ...))
MainStage
doesn't seem to be the right naming for your main application asStage
has a different meaning in JavaFX. – Oriya